Skip to content

feat: align CLI with upstream exe.dev command surface & fleet resource specs#14

Merged
lollipopkit merged 3 commits into
mainfrom
feat/upstream-cli-alignment
Jul 10, 2026
Merged

feat: align CLI with upstream exe.dev command surface & fleet resource specs#14
lollipopkit merged 3 commits into
mainfrom
feat/upstream-cli-alignment

Conversation

@lollipopkit

@lollipopkit lollipopkit commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Audited the code against the exe.dev CLI reference as of 2026-07-10 (https://exe.dev/docs/cli-*.md) and brought the typed wrappers back in sync. Since clap rejects unknown flags, every gap here previously blocked users from reaching upstream features without the exec -- escape hatch.

exedev-ctl command surface

  • New commands: comment <vm> <text> (empty text clears), invite (show/link/rewards/set-reward/activity/request/manage)
  • Removed stale: billing update and ls -a no longer exist upstream; billing gains usage (--range)/credits/rewards/capacity/manage, ls gains --group
  • New flags: new --comment/--cpu/--memory/--registry-auth/--tag, cp --cpu/--memory, domain add --wildcard, ssh-key add --tag
  • resize: all of --memory/--cpu/--disk optional (at least one required, validated locally)
  • tag: accepts multiple tag names per call
  • team: bare team allowed; adds disable/role/rename/billing update/transfer/auth set/settings vm-sharing/vm ls. team disable forwards --yes after the local confirmation since /exec has no pty
  • integrations: new edit subcommand; add gains --act-as-user/--comment/--fields/--no-auth; remove/attach/detach/rename gain --team; setup gains --name
  • Dangerous-command guard updated (adds team disable/transfer/role, domain rm, integrations edit, billing capacity; drops billing update)

exedev-k8s fleet resource specs

fleet.yaml now supports optional cpu, memory, and tags (exe.dev VM tags, distinct from k8s labels) at defaults, cluster.controlPlane, and pool level. Pool values override defaults; tags are unioned. Values flow into new --cpu/--memory/--tag and show up in plan output.

Docs

  • docs/exe-dev-api-reference.md, docs/exedev-automation.md, docs/node-labeling.md refreshed against upstream pages and current implementation
  • Skill docs: fixed release-archive extraction (./ member prefix), documented dual-binary archives, new command examples

Testing

  • cargo fmt --check, cargo check --workspace, cargo test --workspace (52 tests) all pass
  • Read-only live smoke against exe.dev over SSH: ls, ls --group tag, billing plan, invite activity, help all work; server gates unavailable features per account (e.g. no team without a team) and errors pass through cleanly

Summary by CodeRabbit

  • 新功能
    • 虚拟机列表支持按组筛选;VM 标签支持多值,创建/调整支持备注与更多资源参数;域名支持通配符配置;SSH 密钥可按标签作用。
    • 团队命令扩展(角色/重命名/账单/转移/认证/设置/VM 列表等),集成新增编辑能力;账单增加用量相关子命令。
    • Fleet 配置可为节点设置 CPU/内存/标签并继承合并,引导计划会展示并应用这些资源与标签。
  • 安全性改进
    • 更精确的危险命令识别与拦截范围调整。
  • 文档
    • 更新 API、自动化、节点调度、Fleet 配置及命令示例,并补充 token/权限与自省说明。

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 07ec3833-905c-496a-bbab-77b59a2fd862

📥 Commits

Reviewing files that changed from the base of the PR and between ca12eb3 and 9823a0a.

📒 Files selected for processing (3)
  • docs/exe-dev-api-reference.md
  • docs/node-labeling.md
  • k8s_cli/src/fleet.rs
✅ Files skipped from review due to trivial changes (1)
  • docs/node-labeling.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • k8s_cli/src/fleet.rs
📜 Recent review details
🔇 Additional comments (3)
docs/exe-dev-api-reference.md (3)

67-68: LGTM!

Also applies to: 104-116, 133-146, 160-190


220-222: LGTM!

Also applies to: 273-274, 286-288


299-307: LGTM!

Also applies to: 327-327, 333-348


📝 Walkthrough

Walkthrough

扩展 exedev-ctl 的 VM、团队、集成、计费等命令,新增参数构建与危险命令检测;Fleet 支持 CPU、内存和标签继承;同时更新 API、自动化、Kubernetes 与 CLI 使用文档。

Changes

CLI 命令与安全规则

Layer / File(s) Summary
命令参数契约
cli/src/cli.rs
新增评论、团队、邀请、集成和计费命令,并扩展 VM 资源、标签、域名及 SSH key 参数。
命令构建与验证
cli/src/cli_command.rs
构建新增 flags 和多值参数,增加 resize 参数校验,并覆盖相关命令输出测试。
危险命令匹配
core/src/shell.rs
更新团队、域名、集成和计费命令的危险命令识别及测试。

Fleet 资源与标签传播

Layer / File(s) Summary
资源配置与计划解析
fleet.example.yaml, k8s_cli/README.md, k8s_cli/src/fleet.rs
配置和计划节点支持 CPU、内存与标签,执行默认值回退、池级覆盖、标签去重合并及 CPU 校验。
创建命令与计划展示
k8s_cli/src/manager/...
VM 创建命令和引导计划输出包含资源与标签,并新增命令生成测试。

API 与自动化文档

Layer / File(s) Summary
API 与 token 文档
docs/exe-dev-api-reference.md
补充 API shape、token 权限、错误处理、VM 转发头及命令授权示例。
自动化与 Kubernetes 流程
docs/exedev-automation.md, docs/node-labeling.md
更新 SSH/Kubernetes 引导流程、exedev-k8s 工具说明和节点调度规则。
CLI 安装与使用示例
skills/exedev-ctl/*
更新安装包内容以及 VM 创建、标签、评论、调整、共享和 token helper 示例。

Sequence Diagram(s)

sequenceDiagram
  participant FleetFile
  participant FleetPlan
  participant exe_new_command
  FleetFile->>FleetPlan: 解析 cpu、memory、tags
  FleetPlan->>exe_new_command: 传递 NodeSpec
  exe_new_command->>exe_new_command: 生成 VM 创建参数
Loading

Possibly related PRs

  • lollipopkit/exedev-cli#7:同样调整 domain CLI 类型定义及命令参数构建,本次变更进一步增加 domain add --wildcard

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
k8s_cli/src/fleet.rs (2)

434-450: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

补充其他 CPU 来源的零值测试。

当前只覆盖 defaults.cpu == 0,而新增逻辑还包含 cluster.controlPlane.cpu、任务池和备用池的校验。建议使用参数化或表驱动测试覆盖这些路径,避免后续回归。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@k8s_cli/src/fleet.rs` around lines 434 - 450, 补充 CPU 为零时其他来源的校验测试:在
rejects_zero_cpu 或相邻测试中采用参数化/表驱动方式,覆盖 cluster.controlPlane.cpu、任务池 CPU 以及备用池
CPU,并断言各路径返回预期验证错误;保留 defaults.cpu 的现有覆盖。

405-432: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

补充控制面 tags 的回归断言。

该测试验证了控制面的 CPU 和 memory 继承,但没有验证控制面 tags 经过 merge_tags 的路径;同时也没有覆盖重复默认标签的去重行为。建议为控制面配置 tags 并增加对应断言。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@k8s_cli/src/fleet.rs` around lines 405 - 432, 为控制面资源补充 tags 合并的回归覆盖。在
resolves_resources_and_merges_tags 测试使用的样例配置中为控制面设置 tags,断言 control.tags
包含默认与控制面标签的合并结果,并验证重复默认标签已去重。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/exe-dev-api-reference.md`:
- Around line 299-306: Update the exedev-ctl command inventory in the API
reference to include the newly supported comment and invite commands alongside
the existing typed wrappers, keeping the documentation consistent with the
command list in skills/exedev-ctl/SKILL.md.
- Around line 323-327: 统一文档中 exedev-k8s 的最小 token 命令列表:将该 JSON 示例的 cmds 从
ls、new、rm、whoami 调整为上文实际需要的 ls、new、rm;除非补充并同步更新 whoami 的实际调用链和相关说明。

In `@docs/node-labeling.md`:
- Around line 3-7: Update the opening statement in the node-labeling
documentation to limit automatic labeling to VMs created or managed by
exedev-k8s bootstrap, while preserving the manual kubectl guidance for
out-of-band nodes and repairs.

In `@k8s_cli/src/fleet.rs`:
- Around line 278-285: 修复 merge_tags,使默认标签自身也参与去重:不要直接保留 defaults.tags
的重复项,应按首次出现顺序构建唯一标签集合,再追加尚未存在的池级 tags,确保返回的是去重后的并集。

---

Nitpick comments:
In `@k8s_cli/src/fleet.rs`:
- Around line 434-450: 补充 CPU 为零时其他来源的校验测试:在 rejects_zero_cpu
或相邻测试中采用参数化/表驱动方式,覆盖 cluster.controlPlane.cpu、任务池 CPU 以及备用池
CPU,并断言各路径返回预期验证错误;保留 defaults.cpu 的现有覆盖。
- Around line 405-432: 为控制面资源补充 tags 合并的回归覆盖。在
resolves_resources_and_merges_tags 测试使用的样例配置中为控制面设置 tags,断言 control.tags
包含默认与控制面标签的合并结果,并验证重复默认标签已去重。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c31d4658-c733-468c-91c6-98d1f50c36dc

📥 Commits

Reviewing files that changed from the base of the PR and between d488561 and ca12eb3.

📒 Files selected for processing (13)
  • cli/src/cli.rs
  • cli/src/cli_command.rs
  • core/src/shell.rs
  • docs/exe-dev-api-reference.md
  • docs/exedev-automation.md
  • docs/node-labeling.md
  • fleet.example.yaml
  • k8s_cli/README.md
  • k8s_cli/src/fleet.rs
  • k8s_cli/src/manager/mod.rs
  • k8s_cli/src/manager/tests.rs
  • skills/exedev-ctl/SKILL.md
  • skills/exedev-ctl/references/exedev-ctl.md
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: CodeRabbit / Review
🧰 Additional context used
🪛 LanguageTool
docs/exedev-automation.md

[grammar] ~56-~56: Ensure spelling is correct
Context: ...age=exeuntu --no-email' ``` Prefer the exeuntu image for k3s nodes; generic minimal im...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

docs/exe-dev-api-reference.md

[style] ~138-~138: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...tespace. - No newlines or null bytes. - No duplicate keys, at any level. - Only `e...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~160-~160: ‘exactly the same’ might be wordy. Consider a shorter alternative.
Context: ... work everywhere exe0 tokens work, in exactly the same way. An exe1 token is validated throu...

(EN_WORDINESS_PREMIUM_EXACTLY_THE_SAME)


[style] ~186-~186: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: .... - Confirm exp is not in the past. - Confirm the exact compact JSON payload was sign...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

skills/exedev-ctl/references/exedev-ctl.md

[grammar] ~136-~136: Ensure spelling is correct
Context: ...B --tag prod --no-email ``` Prefer the exeuntu image for nodes that need `sudo`, `curl...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~164-~164: Consider using the synonym “brief” (= concise, using a few words, not lasting long) to strengthen your wording.
Context: ... -d p1-a-1 prod web Set or clear a short comment on a VM: sh exedev-ctl comm...

(QUICK_BRIEF)

🔇 Additional comments (14)
fleet.example.yaml (1)

6-9: LGTM!

Also applies to: 23-26, 35-38

k8s_cli/README.md (1)

95-108: LGTM!

k8s_cli/src/fleet.rs (1)

33-36: LGTM!

Also applies to: 45-49, 69-72, 84-87, 105-108, 154-159, 168-170, 180-182, 203-205, 223-225, 244-246, 270-276, 355-369

k8s_cli/src/manager/mod.rs (1)

183-187: LGTM!

Also applies to: 615-646

k8s_cli/src/manager/tests.rs (1)

47-49: LGTM!

Also applies to: 59-76

docs/exe-dev-api-reference.md (1)

4-20: LGTM!

Also applies to: 38-69, 104-289, 329-344

docs/exedev-automation.md (1)

35-36: LGTM!

Also applies to: 53-58, 73-89, 122-132, 145-145, 186-188, 201-201, 218-234

docs/node-labeling.md (1)

9-41: LGTM!

Also applies to: 65-80

skills/exedev-ctl/SKILL.md (1)

27-27: LGTM!

Also applies to: 41-41

skills/exedev-ctl/references/exedev-ctl.md (1)

20-62: LGTM!

Also applies to: 125-138, 157-168, 177-181, 193-201, 226-238

cli/src/cli.rs (1)

50-65: LGTM!

Also applies to: 106-110, 114-143, 162-175, 185-207, 293-310, 325-509, 528-533, 570-677, 686-711

cli/src/cli_command.rs (1)

28-105: LGTM!

Also applies to: 190-217, 219-306, 308-316, 331-446, 567-764

core/src/shell.rs (2)

53-59: 🔒 Security & Privacy

确认危险命令前缀覆盖是否完整。

当前将 team disableteam transferteam role 等纳入危险命令,但 team auth set(切换团队身份认证提供方,配置错误可能导致全体成员被锁定)以及 team settings vm-sharing 等团队级配置变更并未列入。请对照 exe.dev CLI 参考确认这些全局性变更是否也应触发本地确认提示。


90-97: LGTM!

Comment thread docs/exe-dev-api-reference.md
Comment thread docs/exe-dev-api-reference.md
Comment thread docs/node-labeling.md Outdated
Comment thread k8s_cli/src/fleet.rs
@lollipopkit

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lollipopkit
lollipopkit merged commit 10aefe4 into main Jul 10, 2026
3 checks passed
@lollipopkit
lollipopkit deleted the feat/upstream-cli-alignment branch July 10, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant