新增 shell 自动补全命令 #134
Loading…
Reference in New Issue
No description provided.
Delete Branch "Mengz/gitlink-cli:mengz/shell-completion"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
新增
gitlink-cli completion [bash|zsh|fish|powershell],让用户安装 CLI 后可以直接生成 Bash、Zsh、Fish、PowerShell 的原生自动补全脚本。这个能力主要补齐跨平台安装体验:GitLink CLI 已经有较多 Shortcut、全局参数和子命令,补全可以降低记忆成本,也方便新用户和 AI Agent 更快发现可用命令。实现上复用 Cobra 官方补全生成接口,支持
--no-descriptions输出更精简的脚本,并补齐中英文 i18n、README 中英文安装示例、共享 Skill 使用提示和doc/changes/shell-completion.md变更说明。测试覆盖四类 shell 的脚本生成、描述开关以及非法 shell 参数校验,避免后续新增根命令时补全入口失效。本地已验证:
go test ./cmd ./internal/i18n通过,go run ./internal/i18n/cmd/check --scan-code通过,go build ./...通过,排除当前 Windows 环境下认证存储测试对 HOME/USERPROFILE 既有假设不一致的cmd/auth与internal/auth后其余包go test通过;同时检查了新增 diff 中无中文乱码,并用go run . completion bash、go run . completion powershell、go run . --lang zh-CN completion --help做了命令级 smoke 验证。d94babcaedto813c67f47e813c67f47eto7433401e8d7433401e8dto5c16a4a70e