add-skill
Use this skill when the user asks to "add a skill", "create a skill", "new skill", "write a skill for", "skill for cx…
Use this skill when the user asks to "add a command", "implement cx <something>", "new subcommand", "new CLI command", "add a new cx command", "create a command", "add subcommand", "implement a new command", "build a cx command", "wire up a new command", "extend the CLI", "add
$ npx -y skills add coralogix/cx-cli --skill add-command --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/add-commandContext preview
The summary Claude sees to decide when to auto-load this skill.
Use this skill when the user asks to "add a command", "implement cx <something>", "new subcommand", "new CLI command", "add a new cx command", "create a command", "add subcommand", "implement a new command", "build a cx command", "wire up a new command", "extend the CLI", "add
name: add-command description: Use this skill when the user asks to "add a command", "implement cx <something>", "new subcommand", "new CLI command", "add a new cx command", "create a command", "add subcommand", "implement a new command", "build a cx command", "wire up a new command", "extend the CLI", "add an API to cx", "new cx feature", "integrate a Coralogix API", or wants to add new functionality to the cx CLI. Use this even when the user describes a feature that implies a new command without saying "command" explicitly. version: 0.1.0 metadata: internal: true
End-to-end workflow for adding a new command to `cx`. Every command falls into one of two archetypes - determine which one first, then follow the corresponding steps.
`docs/adding-a-command.md` has copy-pasteable code templates for every step below. Read it alongside this workflow.
Before writing any code, get clarity on the domain:
1. **What Coralogix API are you wrapping?** Find the API docs or example responses. Understand the data model - what entities exist, what fields they have, what operations are supported. 2. **What should the user be able to do?** List the subcommands (e.g., `list`, `get`, `create`) and what flags make sense. 3. **Does this belong under a wrapper group?** The CLI organizes related commands into wrapper groups. Check if your command fits under an existing group before creating a top-level command:
Run `cx schema` to see the full command tree as JSON. 4. **Which archetype fits?**
| Archetype | When to use | Reference implementation | |-----------|------------|--------------------------| | **A: DataPrime-based** | Querying logs, spans, or any DataPrime source | `src/commands/logs/mod.rs` | | **B: REST-based** | Wrapping a Coralogix REST API (most new commands) | `src/commands/alerts/api.rs` + `src/commands/alerts/mod.rs` |
DataPrime commands delegate to a shared pipeline and require minimal code (~130 lines). REST commands build the full pipeline (API client, fan-out, merge, render) - more code but more control.
**Important:** All API integrations must use REST (HTTP). The CLI is HTTP-only by design - do not use gRPC.
Before writing any code, read these files to internalize the existing patterns. This step is critical - agents that read existing code first produce implementations that are consistent with the codebase rather than inventing new patterns.
**Always read:**
**DataPrime archetype - also read:**
**REST archetype - also read:**
> Skip this step for DataPrime commands - they use the shared DataPrime pipeline.
Create `src/commands/<domain>/api.rs`. See `docs/adding-a-command.md` § "Archetype B, Step 1" for the full template.
Key conventions and why they matter:
Create `src/commands/<domain>/mod.rs`. For REST commands, declare `pub mod api;` at the top so the handler can `use api::{...};` types from its sibling `api.rs`. See `docs/adding-a-command.md` for full templates of both archetypes.
Provide two things: 1. A text renderer: `pub fn render_<domain>_text(merged: &MergedResults) -> Result<()>` - called only for `OutputFormat::Text`; JSON and Agents output are handled by the
The observability backbone for AI agents and engineering teams. Connect your agents to live logs, traces, metrics, dashboards, and alerts so they can investigate incidents, explain what changed, and reason about production with real operational context.
Use this skill when the user asks to "add a skill", "create a skill", "new skill", "write a skill for", "skill for cx…
Creates GitHub pull requests with auto-generated summaries. Use this skill whenever the user wants to create a PR, open a pull…
Use this skill when the user asks to "run tests", "test this", "check if tests pass", "cargo test", "run clippy", "lint this",…
Search and read official Coralogix platform documentation using **`cx docs search`** and **`cx docs fetch`**. Use when the user…
Use this skill for any question or action about the user's AI/GenAI applications or agents — their behavior, prompts/responses,…
This skill should be used when the user asks to "manage alerts", "create alert", "list alerts", "delete alert", "check alert…