cx-cli
coralogix/cx-cli · 5.2k installs · 243 stars
Skill Cross-cutting behaviors for all cx CLI commands.
Marked Command Execution · Indirect Prompt Injection
Install
The repo has no one-line install. Follow its README.
Files
cx-cli
Cross-cutting behaviors for all cx CLI commands.
Update Notifications
After running any cx command, check for update notices using the channels below (in priority order). If an update is available, finish answering the user's request first, then mention the update once at the end.
There are three kinds of notice:
- Binary update — a newer cx version exists. The notice has two parts: the binary upgrade and the skills refresh. Offer both commands, binary first.
- Skills-only update — cx itself is on the newest version, but the installed agent skills are older than it (typical right after
brew upgrade cx), or cx can't tell which version they are. Offer only the skills refresh command. - Skills refreshing — the installed skills are older than cx (or cx can't tell their version), and cx is now refreshing them itself in the background (
reason: "refreshing"). No action is needed: say once that the cx skills are being updated and take effect in a new agent session. Don't offer a command.
1. Primary — toon mode (-o toon)
Commands with --output toon append a standalone trailing JSON line to stdout. Binary update:
{"_meta":{"update":{"binary":{"current":"0.1.7","latest":"0.2.0","command":"brew upgrade cx"},"skills":{"command":"cx skills install --global","docs":"https://github.com/coralogix/cx-cli#install"}}}}
Skills-only update (no binary key). reason is "outdated" (cx installed the skills for an older version), "unknown_version" (cx did not install them, so it can't tell their version), or "refreshing" (cx started the refresh itself; no action needed). installed_for is the cx version the skills were installed for, or null when unknown:
{"_meta":{"update":{"skills":{"command":"cx skills install --global","docs":"https://github.com/coralogix/cx-cli#install","reason":"outdated","installed_for":"0.1.20"}}}}
Scan the last line of stdout for _meta.update. When present:
- Binary upgrade (only if
_meta.update.binaryexists):.binary.command(current:.binary.current, latest:.binary.latest) - Skills refresh:
_meta.update.skills.command
2. Schema startup check
cx schema embeds the same _meta.update object at the top level of the schema JSON (not a trailing line). Check _meta.update.binary and _meta.update.skills the same way.
3. Fallback — human-readable text
Also scan stderr and stdout for plain-text notices. A binary update shows binary and skills on one line, separated by |:
[cx update] v0.2.0 available (you have 0.1.9) | upgrade: brew upgrade cx | skills: cx skills install --global
A skills-only update, for outdated or unknown-version skills:
[cx update] cx agent skills are older than cx 0.1.9 | skills: cx skills install --global
[cx update] cx can't tell which version your cx agent skills are | skills: cx skills install --global
Skills refreshing (no command, nothing to run):
[cx update] refreshing cx agent skills for cx 0.1.9 in the background
TTY text mode uses two lines; for a binary or skills-only update the second line names the skills command after skills::
cx 0.2.0 is available (you have 0.1.9).
upgrade: brew upgrade cx | skills: cx skills install --global
These appear on stderr for text/json mode after normal commands.
Response template
Binary update:
[Summarize the command result here]
A newer cx version (X.Y.Z) is available — you have A.B.C. Would you like me to run
<binary upgrade command>and then<skills command>to update?
Skills-only update:
[Summarize the command result here]
Your cx agent skills may be older than your cx version, so some commands may be missing from them. Would you like me to run
<skills command>to update them?
Skills refreshing:
[Summarize the command result here]
cx is updating its agent skills in the background. The new skills apply in a new agent session.
Keep it to one brief closing line. Don't repeat on later commands in the same session.
General cx CLI Guidelines
- Always use
--output toonfor machine-readable output when processing results programmatically - Use
cx schemato discover available commands and their flags - Commands support multi-profile fan-out with
-p profile1 -p profile2, or--label <label>to fan out across every profile tagged with that label (cx profiles listshows labels;cx profiles labels add <name> --label <label>tags one) - For commands that query or manage Coralogix data, use
--http-timeout <SECONDS>orCX_HTTP_TIMEOUT=<SECONDS>to set an API request deadline. - Use
--yesto skip confirmation prompts in scripts - Use
--read-onlyfor safe exploration without risk of modifications
Facts
- Kind
- Skill
- Repo
- coralogix/cx-cli
- Group
- Uncategorized
- Installs
- 5.2k
- Stars
- 243