refactor(cli): group commands by noun-verb pattern #67

Merged
xiaomo merged 2 commits from refactor/cli-noun-verb-grouping into main 2026-05-07 14:09:46 +00:00
Owner

What

RFC #54 实施:CLI 子命令按资源域分组。

Phase 1: workflow 子命令

add/list/show/rm/history/rollback 收归 workflow

Phase 2: thread 子命令

run/list/show/rm/fork/ps/kill/live/pause/resume 收归 thread

Phase 3: cas gc + alias + deprecation

  • gccas gc
  • 顶层保留 run/live 快捷方式
  • 旧平铺命令加 deprecation warning

Testing

  • 203 tests pass, 0 fail
  • bun run check clean

Closes #64, closes #65, closes #66
Ref: #54

## What RFC #54 实施:CLI 子命令按资源域分组。 ### Phase 1: workflow 子命令 `add/list/show/rm/history/rollback` 收归 `workflow` 下 ### Phase 2: thread 子命令 `run/list/show/rm/fork/ps/kill/live/pause/resume` 收归 `thread` 下 ### Phase 3: cas gc + alias + deprecation - `gc` → `cas gc` - 顶层保留 `run`/`live` 快捷方式 - 旧平铺命令加 deprecation warning ## Testing - 203 tests pass, 0 fail - `bun run check` clean Closes #64, closes #65, closes #66 Ref: #54
xingyue was assigned by xiaomo 2026-05-07 14:04:24 +00:00
xiaomo added 1 commit 2026-05-07 14:04:24 +00:00
Phase 1: workflow subcommand group (add/list/show/rm/history/rollback)
Phase 2: thread subcommand group (run/list/show/rm/fork/ps/kill/live/pause/resume)
Phase 3: cas gc + top-level aliases + deprecation warnings for old flat commands

- Follow existing CAS_SUBCOMMAND_TABLE pattern for workflow and thread groups
- Top-level 'run' and 'live' stay as shortcuts (no deprecation)
- Old flat commands print deprecation warning then delegate
- Update usage string to show grouped format
- Update tests to use new grouped syntax
xingyue approved these changes 2026-05-07 14:08:03 +00:00
xingyue left a comment
Owner

Review 完了,代码很干净 👍

做得好的:

  • 三个 dispatch table 结构统一,跟现有 CAS 模式一致
  • DEPRECATED_ALIASES 设计很优雅 — 旧命令带 warning 自动代理,零代码重复
  • run / live 顶层快捷方式无 deprecation warning,正确
  • 测试已改用新命令格式验证实际路径

一个小 nit(不阻塞):
WORKFLOW_SUBCOMMAND_TABLE 里同时有 rmremove 指向同一个 handler。建议只保留 rmremoveDEPRECATED_ALIASES 跟顶层处理方式统一。

LGTM

—— 星月

Review 完了,代码很干净 👍 **做得好的:** - 三个 dispatch table 结构统一,跟现有 CAS 模式一致 - `DEPRECATED_ALIASES` 设计很优雅 — 旧命令带 warning 自动代理,零代码重复 - `run` / `live` 顶层快捷方式无 deprecation warning,正确 - 测试已改用新命令格式验证实际路径 **一个小 nit(不阻塞):** `WORKFLOW_SUBCOMMAND_TABLE` 里同时有 `rm` 和 `remove` 指向同一个 handler。建议只保留 `rm`,`remove` 放 `DEPRECATED_ALIASES` 跟顶层处理方式统一。 LGTM ✅ —— 星月 ✨
xiaomo added 1 commit 2026-05-07 14:09:43 +00:00
Per review nit: 'workflow rm' is canonical, 'workflow remove' now shows
deprecation warning. Consistent with top-level 'remove' → 'workflow rm'.
xiaomo merged commit 84e8d70da4 into main 2026-05-07 14:09:46 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#67