add-command
Use this skill when the user asks to "add a command", "implement cx <something>", "new subcommand", "new CLI command", "add a new…
Use this skill when the user asks to "check data usage", "list TCO policies", "reduce Coralogix costs", "optimize observability spend", "lower our logging bill", "data budget exceeded", "TCO policy", "retention tier", "archive storage", "ingestion costs", "frequent search vs
$ npx -y skills add coralogix/cx-cli --skill cx-cost-optimization --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/cx-cost-optimizationContext preview
The summary Claude sees to decide when to auto-load this skill.
Use this skill when the user asks to "check data usage", "list TCO policies", "reduce Coralogix costs", "optimize observability spend", "lower our logging bill", "data budget exceeded", "TCO policy", "retention tier", "archive storage", "ingestion costs", "frequent search vs
name: cx-cost-optimization description: > Use this skill when the user asks to "check data usage", "list TCO policies", "reduce Coralogix costs", "optimize observability spend", "lower our logging bill", "data budget exceeded", "TCO policy", "retention tier", "archive storage", "ingestion costs", "frequent search vs archive", "why is our bill so high", "spending too much on logs", "data retention settings", "cost analysis", "usage breakdown", "optimize log volume", "control data ingestion", "archive cold data", "billing units", "plan consumption", "daily plan", "overage", "PAYG", "usage anomaly", "usage trend", "cx_data_usage_units", or wants to investigate, analyze, or reduce Coralogix data costs. metadata: version: "0.1.0"
Use this skill when investigating or reducing Coralogix data costs. It covers the full cost management lifecycle: measuring current spend, reviewing TCO policies, adjusting retention periods, and configuring archive storage for cold data.
---
| Command | Subcommands | Purpose | |---|---|---| | `cx usage` | `summary`, `daily`, `logs-count`, `spans-count`, `export-status`, `capabilities`, `query` | Measure current data consumption and billable usage | | `cx tco` | `list`, `get`, `create`, `update`, `delete`, `reorder`, `test`, `settings`, `settings-update` | Manage TCO (Total Cost of Ownership) policies | | `cx retentions` | `list`, `update`, `activate`, `status` | Manage data retention periods | | `cx archive logs` | `get`, `set` | Configure logs archive target | | `cx archive metrics` | `get`, `create`, `update`, `enable`, `disable`, `validate` | Configure metrics archive storage | | `cx metrics query` | `<promql>` (positional), `--time` | Query billing and usage metrics via PromQL (instant) | | `cx metrics query-range` | `<promql>` (positional), `--start`/`--end` | Query billing and usage metrics via PromQL (range) |
Key flags:
---
For billable totals, quota units, plan consumption, or a supported usage breakdown, use this mandatory two-step workflow:
1. Run `cx usage capabilities` in the current session. 2. Build and run `cx usage query` using only that response.
Do not call `cx usage query` first and do not guess labels, measurement kinds, units, filter values, intervals, or request limits. They are tenant-specific and can change.
# Inspect the currently valid dimensions and constraints
cx usage capabilities -o json
# Submit a capabilities-derived request inline
cx usage query --query '{"daily":{"relativeRange":"DAILY_RELATIVE_RANGE_LAST_7_DAYS"}}' -o json
# Or read the same request from a file or stdin
cx usage query --from-file usage-query.json -o json
printf '%s' '{"daily":{"relativeRange":"DAILY_RELATIVE_RANGE_LAST_7_DAYS"}}' \
| cx usage query --from-file - -o jsonLoad [`references/data-usage-query-api.md`](references/data-usage-query-api.md) before creating the query body. It defines the capability and response schemas, valid interval forms, and limits.
---
Follow these steps to diagnose and reduce costs:
For billable totals, quota units, plan consumption, or supported breakdowns, first follow the mandatory two-step workflow above:
cx usage capabilities -o json cx usage query --from-file usage-query.json -o json
Build `usage-query.json` only from the immediately preceding capabilities response. Do not use the legacy commands below as a substitute for an authoritative billing answer.
For a legacy consumption overview and log/span record counts, use:
cx usage summary -o json cx usage summary --start now-30d -o json cx usage daily --type processed-gbs --start now-7d -o json cx usage logs-count --start now-7d --end now -o json cx usage spans-count --start now-7d --end now -o json
Identify which data types consume the most volume. Use `jq` to sort:
cx usage summary -o json | jq '[.[] | {name, daily_avg: .avg_daily_gb}] | sort_by(.daily_avg) | reverse'cx tco list -o json cx tco settings -o json
TCO policies control which logs go to Frequent Search (expensive, fast) vs. Archive (cheap, slower). Check if high-volume, low-value logs are on Frequent Search:
cx tco list -o json | jq '.[] | select(.priority == "LOW") | {name, application, subsystem, archive_retention}'cx retentions list -o json cx retentions status -o json
Long retention periods increase storage costs. Identify indic
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 command", "implement cx <something>", "new subcommand", "new CLI command", "add a new…
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,…