SYSTEM Cited by 1 source
gcx (Grafana Cloud CLI)¶
gcx is Grafana Labs' open-source command-line tool
(github.com/grafana/gcx) that
exposes Grafana Cloud's full observability lifecycle —
instrumentation, alerts, SLOs, synthetic checks, frontend +
application + Kubernetes monitoring, dashboards-as-code — as a
single CLI surface explicitly designed with AI agents as the
primary caller. Launched in April 2026 and positioned in the
company's framing as "git or kubectl for observability" — the
agent runs the command, reads the output, moves on; no wrapper,
no shim.
Why it shows up on this wiki¶
gcx is the first observability-vendor CLI on the wiki that
explicitly states the agent-primary design stance and ships the
full agent-ergonomic commitment list in one tool. It sits in the
same design lineage as Cloudflare's unified CLI
(systems/cf-cli) and Fly.io's flyctl
(systems/fly-flyctl), but specialises the agent-ergonomic-CLI
pattern to the observability altitude — CI-reachable
instrumentation validation, SLO-as-code, synthetic-check
lifecycle, and "read the state of the running system" as the
new baseline for agent-driven troubleshooting.
Surface area¶
The launch post enumerates four named lifecycle axes that gcx
covers (exact command shapes not yet disclosed in the post; the
github.com/grafana/gcx README is the authoritative surface):
| Axis | Scope |
|---|---|
| Instrumentation | Wire OpenTelemetry into a codebase; validate that metrics/logs/traces are flowing; confirm data is landing in the right backends |
| Alerting, SLOs, synthetics | Generate alert rules from emitted signals; define an SLO against a real latency or availability indicator; stand up synthetic probes |
| Frontend / Application / K8s Observability | Onboard Faro-instrumented frontends + manage sourcemaps; onboard backend services and K8s infrastructure via Instrumentation Hub |
| Everything as code | Pull dashboards, alerts, SLOs, and synthetic checks as local files; edit them locally with the agent; push them back |
Agent-ergonomic design commitments¶
The post names seven commitments that make gcx an agent-first
CLI. Each is a canonical wiki instance of a pre-existing
agent-ergonomic-CLI principle (Cloudflare / Fly.io canonical), now
shipped by an observability vendor:
1. Stable structured output — concepts/json-output-stability¶
Every command emits JSON or YAML via --output, "with field
names that stay stable across versions." The "stable across
versions" clause is the load-bearing commitment — prevents silent
parser drift in agent sessions that run against the same tool
weeks apart.
2. Documented, consistent exit codes — concepts/exit-code-semantics¶
"Exit codes and error shapes are documented and consistent, so
an agent can branch on failure and recover on its own instead of
guessing from a stderr string." Agent error handling becomes a
switch on $? rather than an LLM-prompt-to-reparse-stderr.
3. Machine-readable command catalog — concepts/machine-readable-command-catalog¶
"It ships a machine-readable catalog of its own commands and
flags, so agents can discover capabilities at runtime instead of
guessing from stale training data." Distinct from --help text
(human-oriented); the catalog is a first-class parseable
inventory of the tool's entire surface, including which commands
are destructive (see #5).
4. Agent-harness auto-detection — patterns/auto-detect-agent-context¶
"It auto-detects when it's being driven by Claude Code,
Cursor, or similar, and it drops spinners,
truncation, and other human-friendly noise (or force it with
GCX_AGENT_MODE=true)." Humans get the polished default; agents
get the machine-parseable default, automatically — without each
agent needing to know the right env var.
5. Destructive-operation confirmation — patterns/destructive-operation-confirmation-as-agent-guardrail¶
"It will find commands that result in destructive operations, which require explicit confirmation to reduce agent mistakes." The catalog surface tags destructive commands; running them without the confirmation flag fails. Zero-cost guardrail on top of structured output — the tool knows which verbs mutate, not the agent's prompt.
6. Named contexts for multi-stack — concepts/named-contexts-for-multi-stack¶
"kubectl-style named contexts let an agent juggle several
stacks in one session without mutating global state." The
stack target is a per-command parameter, not a global
~/.config toggle — so switching stacks (staging → prod)
doesn't leak into commands already in flight.
7. Deep links back into the Grafana UI — patterns/deep-link-to-ui-from-cli¶
The CLI can emit deep links into Grafana Cloud — "the moment a human needs to look." Agent does the work in the terminal; when human review is needed, hand off to the UI via a precise URL instead of "go navigate to the dashboard."
Agent skills bundle¶
gcx ships a bundle of portable agent skills covering
observability setup, alert investigation, SLO management /
investigations, and synthetic-check investigations. The post's
portability claim: "They work in any harness that follows the
.agents skill convention, including Claude Code, and they can
be installed with one command."
This is a concrete deployment of the
agent-skills primitive:
skills are shipped alongside the tool (vendor-authored, curated)
rather than per-project authored. Installing gcx installs both
the tool and a library of battle-tested observability workflows
for agents that already support the .agents skill convention.
Design-stance contrast¶
| Alternative | gcx posture | Rationale |
|---|---|---|
Direct-exec (gcx … like git, kubectl) |
Primary | "Agents already know how to run git, kubectl, and go test. gcx fits in the same slot." |
| MCP server wrapping gcx | Not in launch post | The patterns/wrap-cli-as-mcp-server pattern remains available for shell-less harnesses but isn't the primary mode |
| Bespoke per-agent integration layer | Rejected | Verbatim: "No wrapper, no shim, no bespoke integration layer." |
| GUI-driven automation | Counter-example | "CLI-driven agents also tend to be cheaper per task and more reliable than equivalent GUI-driven setups." |
Canonical conversation shapes¶
The post lists five agent-driven workflow examples that gcx
unlocks:
- "Why did this endpoint get slower this week?" — agent pulls traces and latency histograms, not just the diff.
- "Is my new query efficient?" — agent runs the PromQL against the actual metrics backend and iterates.
- "Are we meeting the SLO for checkout?" — agent reads the SLO definition and current burn rate before writing a line.
- "This alert is noisy, fix it." — agent inspects the rule, the firing history, and related dashboards, proposes a tuned threshold.
- Ticket-scale onboarding: "What used to be a multi-day ticket becomes a one-agent session."
All five are instances of concepts/agentic-troubleshooting-loop specialised to Grafana Cloud primitives.
Operational numbers¶
- None disclosed in the launch post — no adoption metrics, no catalog size, no per-command latency numbers.
- Open-source repository: github.com/grafana/gcx.
Caveats¶
- Launch-post level of detail. Exact command shapes, the field-stability enforcement mechanism, and the agent-harness detection mechanism aren't disclosed in the post. The principles are — the architecture isn't.
- Grafana Cloud–targeted.
gcxis a Grafana Cloud CLI; the "everything as code" surface maps to Grafana Cloud dashboards/alerts/SLOs/synthetics. Not a general-purpose cross-vendor observability CLI. - Agent-skill
.agentsconvention referenced but not respecified. The post asserts portability across any harness following the.agentsskill convention; the convention itself isn't re-specified here (see concepts/agent-skills-discovery). - Confirmation mechanism shape is conceptual, not specified.
"Explicit confirmation" — the flag name, whether it's a
--yes/--force/--i-really-mean-itshape, isn't published in the post.
Seen in¶
- sources/2026-04-29-grafana-get-observability-in-the-terminal-for-you-and-your-agents-with-the-gcx-cli-tool — gcx launch post. Canonicalises (1) gcx as an agent-ergonomic observability CLI covering the full Grafana Cloud observability lifecycle, (2) the seven design commitments as a single shipping commitment list, (3) the direct-exec-over-MCP-wrapper stance, (4) the bundled portable agent-skills library, and (5) the five canonical conversation shapes that define agent-driven observability troubleshooting.
Related¶
- systems/grafana-cloud — the underlying managed platform
- systems/grafana — the dashboard / visualisation UI that deep-links back to
- systems/grafana-faro — the frontend observability SDK whose onboarding is one of the gcx lifecycle axes
- systems/opentelemetry — the instrumentation target for the gcx "Instrumentation" axis
- systems/claude-code — named in the post as one of the harnesses gcx auto-detects
- systems/cursor — named likewise
- systems/cf-cli — sibling agent-ergonomic CLI from Cloudflare at the developer-platform altitude
- systems/fly-flyctl — sibling agent-ergonomic CLI from Fly.io
- systems/model-context-protocol — the complementary protocol for shell-less agent harnesses
- concepts/observability-as-code
- concepts/agent-ergonomic-cli
- concepts/cli-convention-enforcement
- concepts/structured-output-reliability
- concepts/machine-readable-command-catalog
- concepts/progressive-capability-disclosure
- concepts/exit-code-semantics
- concepts/json-output-stability
- concepts/named-contexts-for-multi-stack
- patterns/observability-as-code
- patterns/auto-detect-agent-context
- patterns/destructive-operation-confirmation-as-agent-guardrail
- patterns/deep-link-to-ui-from-cli
- patterns/alerts-as-code
- patterns/wrap-cli-as-mcp-server
- companies/grafana