工具链
cli-tools
更新于 2026-09-26
CLI Tooling 工程规则
CLI rules: structured output, typed exit codes and dry-run modes
- 技术栈
- CLI Tooling
- 主题
- 工程基线
- 条目
- 9 条
- 版本
- v0.2.0
✓ 应当这么做
- ✓ Parse structured output (XML/JSON) rather than grepping human-readable text
- ✓ Derive every input value from the environment instead of hardcoding hosts or ports
- ✓ Log the exact command and arguments at debug level for reproducibility
✕ 常见反模式
- ✕ Destructive actions without a dry-run mode
- ✕ Assuming elevated privileges or a specific OS package layout
- ✕ Bypassing the tool success/failure exit status
◎ 交付前验证
- ◎ Dry-run output reviewed before a real execution
- ◎ Tool version pinned and behaviour re-validated after upgrades
- ◎ Failure path returns a clear diagnostic