fix: 补齐全局简写参数并重构 Adapter 命令架构#615
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
| return nil | ||
| }, | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| flags.Version = settings.GetBool("version") |
There was a problem hiding this comment.
-v/--version is wired in RunE, which means the root PersistentPreRunE has already run by the time this shortcut executes. As a result, neocode -v no longer matches neocode version: it still performs global preload, starts the background silent update check, and then runVersionCommand probes releases again. That makes the shortcut observable slower, can fail on preload paths that version intentionally skips, and contradicts the PR goal of keeping the same behavior/exit semantics. This needs to short-circuit before PersistentPreRunE, or the pre-run logic needs to explicitly skip when the root version flag is set.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
变更背景
本 PR 针对 NeoCode CLI 在高频使用场景中的体验断层进行优化,目标是统一用户肌肉记忆、提升命令架构一致性,并为后续多平台适配器扩展预留标准入口。
Closes #549
主要改动
1. 重构适配器命令架构(Breaking Change)
adapterneocode feishu-adapter迁移为:
neocode adapter feishu2. 补齐全局版本查询习惯
-v/--version支持version子命令核心输出逻辑,保证行为与退出语义一致3. 补齐高频参数短别名
--workdir新增短别名-wuse命令模型参数:--model新增短别名-m4. 文档同步
README.md/README.en.mddocs/guides与www站点文档中的命令示例:feishu-adapter->adapter feishu-w、-m写法测试与验证
已新增/更新 CLI 回归测试,覆盖:
adapter feishu命令挂载与行为-v/--version全局入口-w/-m参数解析本地验证:
go test ./internal/cli/...通过兼容性说明
neocode feishu-adapter不再作为可执行主路径neocode adapter feishu