cx-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecx-cli
cx-cli
Cross-cutting behaviors for all cx CLI commands.
适用于所有cx CLI命令的横切行为。
Update Notifications
更新通知
After running any cx command, check for update notices using the channels below (in priority order). If a newer version is available, finish answering the user's request first, then mention the update once at the end.
An update notice always has two parts — binary upgrade and skills refresh. Offer both commands; don't mention only the version number or only the binary upgrade.
运行任何cx命令后,按以下优先级顺序检查更新通知。如果有新版本可用,请先完成用户请求的答复,再在末尾提及一次更新信息。
更新通知始终包含两部分——二进制文件升级和Skills刷新。需同时提供两个命令;请勿仅提及版本号或仅提及二进制文件升级。
1. Primary — agents mode (-o agents
)
-o agents1. 主渠道——代理模式(-o agents
)
-o agentsCommands with append a standalone trailing JSON line to stdout:
--output agentsjson
{"_meta":{"update":{"binary":{"current":"0.1.7","latest":"0.2.0","command":"brew upgrade cx"},"skills":{"command":"npx skills add coralogix/cx-cli","docs":"https://github.com/coralogix/cx-cli#install"}}}}Scan the last line of stdout for . When present:
_meta.update- Binary upgrade: (current:
_meta.update.binary.command, latest:.binary.current).binary.latest - Skills refresh:
_meta.update.skills.command
带有的命令会在标准输出(stdout)末尾追加一行独立的JSON:
--output agentsjson
{"_meta":{"update":{"binary":{"current":"0.1.7","latest":"0.2.0","command":"brew upgrade cx"},"skills":{"command":"npx skills add coralogix/cx-cli","docs":"https://github.com/coralogix/cx-cli#install"}}}}扫描标准输出的最后一行查找字段。当该字段存在时:
_meta.update- 二进制文件升级:(当前版本:
_meta.update.binary.command,最新版本:.binary.current).binary.latest - Skills刷新:
_meta.update.skills.command
2. Schema startup check
2. Schema启动检查
cx schema_meta.update_meta.update.binary_meta.update.skillscx schema_meta.update_meta.update.binary_meta.update.skills3. Fallback — human-readable text
3. 备用渠道——人类可读文本
Also scan stderr and stdout for plain-text notices. Binary and skills appear on one line, separated by :
|[cx update] v0.2.0 available (you have 0.1.9) | upgrade: brew upgrade cx | skills: npx skills add coralogix/cx-cliTTY text mode uses two lines with the same pattern:
upgrade: ... | skills: ...cx 0.2.0 is available (you have 0.1.9).
upgrade: brew upgrade cx | skills: npx skills add coralogix/cx-cliThese appear on stderr for text/json mode after normal commands.
同时扫描标准错误输出(stderr)和标准输出(stdout)查找纯文本通知。二进制文件升级和Skills刷新信息在同一行,用分隔:
|[cx update] v0.2.0 available (you have 0.1.9) | upgrade: brew upgrade cx | skills: npx skills add coralogix/cx-cliTTY文本模式使用两行,同样遵循格式:
upgrade: ... | skills: ...cx 0.2.0 is available (you have 0.1.9).
upgrade: brew upgrade cx | skills: npx skills add coralogix/cx-cli这些文本会在普通命令执行后,以文本/JSON模式输出到标准错误流(stderr)。
Response template
回复模板
[Summarize the command result here]
A newer cx version (X.Y.Z) is available — you have A.B.C. Would you like me to runand<binary upgrade command>to update?npx skills add coralogix/cx-cli
Keep it to one brief closing line. Don't repeat on later commands in the same session.
[在此处总结命令执行结果]
存在更新的cx版本(X.Y.Z)——您当前使用的是A.B.C。是否需要我运行和<二进制升级命令>来完成更新?npx skills add coralogix/cx-cli
回复需简洁,仅保留一行收尾内容。在同一会话的后续命令中请勿重复提及。
General cx CLI Guidelines
cx CLI通用指南
- Always use for machine-readable output when processing results programmatically
--output agents - Use to discover available commands and their flags
cx schema - Commands support multi-profile fan-out with
-p profile1 -p profile2 - Use to skip confirmation prompts in scripts
--yes - Use for safe exploration without risk of modifications
--read-only
- 以编程方式处理结果时,始终使用获取机器可读的输出
--output agents - 使用探索可用命令及其参数
cx schema - 命令支持通过实现多配置文件扩展
-p profile1 -p profile2 - 在脚本中使用跳过确认提示
--yes - 使用进行安全探索,避免产生修改风险
--read-only