CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

Coralogix CLI

$ cx 官方出品 中风险
Coralogix · 办公协作与 SaaS · Apache-2.0 · macos / linux / windows

Coralogix CLI(cx)支持使用 DataPrime 与 PromQL 查询日志、链路与指标(cx logs、cx spans、cx metrics、cx dataprime),管理告警与 SLO,并提供 cx schema 供 Agent 自发现命令。原生支持 -o json、紧凑 -o toon 输出及 --url、--label 作用域控制。

FCRS-1.0 综合评分
90 /100
极佳 (Excellent)
中置信度 (源码/文档)
零摩擦安装命令
brew install cx
CLI vs MCP 选型建议 优先选 CLI

cx 内置 cx schema 命令树自省与面向 LLM 优化的 -o toon 紧凑序列化格式,查询遥测日志时比冗长的 JSON MCP 载荷更省 Token。

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
✓ 自省/Schema 发现
✓ 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 24 / 25

专为编码 Agent 打造,具备 -o json、省 Token 的 -o toon、cx schema JSON 自省以及 --url、--label 非交互标志。

  • Supports -o json and LLM-optimized -o toon output formats
  • Exposes cx schema to dump the full command tree programmatically
安全与权限边界 20 / 25

基于作用域 API 密钥与区域 --url / --label 参数防止跨环境误操作,但告警与 SLO 变更缺少 --dry-run。

  • Explicit --url and --label flags scope target regions
  • Supports separate alerts enable / alerts disable toggles
安装与运行摩擦 14 / 15

可通过 Homebrew(brew install cx)及跨平台发布二进制直接安装。

  • Single-binary install via brew install cx
能力覆盖与边际价值 14 / 15

单工具统一覆盖 DataPrime 日志、链路、PromQL 指标、告警与 SLO 检查,上下文开销极低。

  • Cross-pillar telemetry querying (logs, spans, metrics, alerts, slos)
维护与来源背书 9 / 10

Coralogix 官方仓库(coralogix/cx-cli),Apache-2.0 开源协议。

  • First-party coralogix/cx-cli repository
文档与可验证性 9 / 10

提供 cx schema 运行时自省、官方 Agent Skill 指引与完整的 Coralogix CLI 文档。

  • Official docs and cx schema self-describing command tree

安全边界、鉴权与放权指南

鉴权方式
环境变量密钥 本地配置文件
凭证存储位置

将区域配置文件保存在 ~/.cx/,或读取 CORALOGIX_API_KEY 环境变量及 --url / --label 覆盖参数。

潜在副作用
只读查询 远端写入 破坏性删除
费用与配额提示

Apache-2.0 开源 CLI 免费;需配合 Coralogix 账号及对应权限的 API 密钥使用。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# Coralogix CLI (cx) Agent Rules
- Always include `| limit <N>` in DataPrime queries and use `-o toon` or `-o json`.
- Run `cx schema` to verify exact command arguments before mutating `cx alerts` or `cx slos`.
- Pass `--label` / `--url` or `CORALOGIX_API_KEY` explicitly to target the right Coralogix region.

Agent 高频安全命令配方

只读查询(安全推荐)

以紧凑 TOON 格式查询 DataPrime 日志
cx dataprime query "source logs | filter \$l.applicationname == 'api' | limit 20" -o toon

执行带行数限制的 DataPrime 日志查询,并输出专为 Agent 优化的 -o toon 紧凑格式。

以 JSON 列出告警规则
cx alerts list -o json

在不改动远端配置的前提下获取结构化 JSON 格式的 Coralogix 告警定义。

受控写入与预演

按 ID 停用告警规则
cx alerts disable <alert-id> -o json

暂停噪音告警规则并返回更新后的 JSON 状态。

核心优势

  • + 原生 -o toon 格式在读取大批量日志和链路数据时显著降低上下文 Token 消耗。
  • + cx schema 为 Agent 提供全量子命令与参数的机器可读发现能力。

注意事项与踩坑点

  • ! 未加 limit 限制的 DataPrime 查询仍可能返回较大载荷。
  • ! cx alerts create、cx alerts delete 和 cx slos 等写操作缺少通用 --dry-run。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI