fix(cli): usage 输出不应为红色 + help 改为 skill 子命令 + --help flag #83

Closed
opened 2026-05-07 15:12:19 +00:00 by xingyue · 0 comments
Owner

Problems

1. 无参数 usage 输出是红色

uncaged-workflow 无参数运行时打印 usage,但用的是 printCliError(红色),看起来像报错了。这是正常行为,应该用普通输出。

2. help --skill <topic> 路径不直觉

当前要查 skill 文档需要 uncaged-workflow help --skill cli,层级太深。

3. 缺少 --help flag

标准 CLI 应该支持 uncaged-workflow thread --help 查看 thread 子命令的帮助。

Proposal

无参数 usage 改为普通输出

uncaged-workflow 无参数时用 printCliLine 而非 printCliError,退出码保持 1。

helpskill 子命令

# 列出所有 skill topics
uncaged-workflow skill

# 查看具体 topic
uncaged-workflow skill cli
uncaged-workflow skill develop
uncaged-workflow skill author

移除 help 子命令(或保留为 deprecated alias)。

--help flag

每个子命令支持 --help

uncaged-workflow --help              # 等同于无参数,打印 usage
uncaged-workflow thread --help       # 打印 thread 子命令列表
uncaged-workflow workflow --help     # 打印 workflow 子命令列表
uncaged-workflow cas --help          # 打印 cas 子命令列表

Implementation Notes

  • runCli 和各 dispatchGroup 检查 argv 中的 --help
  • printCliError 只用于真正的错误(unknown command、参数缺失等)
  • help 保留为 deprecated alias → skill
## Problems ### 1. 无参数 usage 输出是红色 `uncaged-workflow` 无参数运行时打印 usage,但用的是 `printCliError`(红色),看起来像报错了。这是正常行为,应该用普通输出。 ### 2. `help --skill <topic>` 路径不直觉 当前要查 skill 文档需要 `uncaged-workflow help --skill cli`,层级太深。 ### 3. 缺少 `--help` flag 标准 CLI 应该支持 `uncaged-workflow thread --help` 查看 thread 子命令的帮助。 ## Proposal ### 无参数 usage 改为普通输出 `uncaged-workflow` 无参数时用 `printCliLine` 而非 `printCliError`,退出码保持 1。 ### `help` → `skill` 子命令 ```bash # 列出所有 skill topics uncaged-workflow skill # 查看具体 topic uncaged-workflow skill cli uncaged-workflow skill develop uncaged-workflow skill author ``` 移除 `help` 子命令(或保留为 deprecated alias)。 ### `--help` flag 每个子命令支持 `--help`: ```bash uncaged-workflow --help # 等同于无参数,打印 usage uncaged-workflow thread --help # 打印 thread 子命令列表 uncaged-workflow workflow --help # 打印 workflow 子命令列表 uncaged-workflow cas --help # 打印 cas 子命令列表 ``` ## Implementation Notes - `runCli` 和各 `dispatchGroup` 检查 argv 中的 `--help` - `printCliError` 只用于真正的错误(unknown command、参数缺失等) - `help` 保留为 deprecated alias → `skill`
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#83