Get observability in the terminal, for you and your agents, with the gcx CLI tool

Get observability in the terminal, for you and your agents, with the gcx CLI tool

2026-04-286 min
Twitter
Facebook
LinkedIn

The way you write code is changing, which means the way you observe your systems and respond to issues needs to change, too.

Engineers today spend much of their day working via command line, as agentic tools like Cursor and Claude Code have become highly effective at handling many day-to-day engineering tasks. This greatly accelerates code generation, but it doesn't solve for the context switching that comes when you have to jump into another tool that's not part of this new, faster workflow.

Moreover, agents introduce a new visibility gap: they can see your code on your machine, but they're blind to what's going on in your production environment. They don't see the latency spike on checkout. They don't know whether you're actually hitting your SLOs. They write code based on what could happen rather than what is actually happening.

To address these issues, we've launched the public preview of gcx, the new Grafana Cloud CLI. gcx brings Grafana Cloud and Grafana Assistant directly into your terminal—and to the agentic coding environment running inside it—so you can spot and resolve incidents in minutes instead of hours.

From greenfield to full observability in minutes

gcx is built to do the heavy lifting. Most services start out with no instrumentation, no alerts, and no SLOs. That's the normal state of things, and gcx treats it as a starting line rather than a blocker.

A screenshot of the gcx CLI, including a list of available commands

All you have to do is point your agent at the service and ask it to bring it up to standard. gcx exposes the primitives it needs across the full observability lifecycle:

  • Instrumentation: Wire OpenTelemetry into the codebase; validate that metrics, logs, and traces are flowing; confirm the data is landing in the right metric, logs, and traces backends—all from the terminal.
  • Alerting, SLOs, and synthetics check: Generate alert rules from the signals your service actually emits. Define an SLO against a real latency or availability indicator and push it live. Stand up synthetic probes so users aren't the ones reporting the outage.
  • Frontend Observability, Application Observability, and Kubernetes Monitoring: Onboard a Faro-instrumented frontend, create the app, and manage sourcemaps so stack traces are readable. Onboard backend services and Kubernetes infrastructure with Instrumentation Hub
  • Everything as code: Pull dashboards, alerts, SLOs, and checks as files. Edit them locally with your agent. Push them back. Open a deep link into Grafana Cloud the moment a human needs to look.

With all this in one place, what used to be a multi-day ticket becomes a one-agent session.

Why this matters for agents

Being able to access Grafana via the command line and manage your observability as code is great, but the real power of gcx shines through when you give your agents access to it.

Without production context, an agent is pattern-matching on source files and hoping to find the right answer. With gcx, the same agent can read the state of the running system and make more informed decisions based on actual production observations rather than assumptions,

As a result, the shape of the conversation changes. Here are just a few examples of the questions you might ask as a user, along with in how it interprets and responds to those requests by using gcx:

  • "Why did this endpoint get slower this week?" The agent pulls traces and latency histograms, not just the diff.
  • "Is my new query efficient?" The agent runs the PromQL query against the actual metrics backend instance and iterates on the result.
  • "Are we meeting the SLO for checkout?" The agent reads the SLO definition and the current burn rate before writing a line.
  • "This alert is noisy, fix it." The agent inspects the rule, the firing history, and the related dashboards, then proposes a tuned threshold.

How GCX behaves when an agent drives it

It's become clear that agentic coding tools belong in the terminal. CLIs match how models actually reason—text in, text out, stable exit codes—and they compose with every credential and config the developer already has. CLI-driven agents also tend to be cheaper per task and more reliable than equivalent GUI-driven setups.

gcx is built for this world because it's built with agents in mind, helping them respond faster to CLI outputs while also helping to reduce the token burn.

Agents already know how to run git, kubectl, and go test. gcx fits in the same slot, and its defaults are tuned for the case where an LLM is the caller.

Two things matter most when an LLM (instead of a human at a keyboard) is the caller:

  • Every command emits JSON or YAML via --output, with field names that stay stable across versions. That way, an agent parsing today's response will still work next month
  • 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.

Beyond that, gcx is tuned for the agent case in the ways you'd expect: 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). 

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. For example, it will find commands that result in destructive operations, which require explicit confirmation to reduce agent mistakes. And kubectl-style named contexts let an agent juggle several stacks in one session without mutating global state.

The agent calls gcx the way it already calls git or kubectl: run the command, read the output, move on. No wrapper, no shim, no bespoke integration layer. 

Try gcx today, and get a jumpstart with custom observability skills

To get started, install gcx from https://github.com/grafana/gcx. From there, point it at your Grafana Cloud stack, hand it to your coding agent, and start fixing struggling services in minutes.

And while capable agents can work out most gcx workflows on their own, we also include a bundle of portable agent skills to accelerate tasks that come up often.

Skills are specialized instructions designed to guide AI agents, and the gcx agent skills cover observability setup, alert investigation, SLO management and investigations, synthetic check investigations and more. They work in any harness that follows the .agents skill convention, including Claude Code, and they can be installed with one command. 

$ gcx skills install --all

Next, run gcx skills list to see the complete list of available skills.

And from there, you can start putting gcx to use, helping to reduce alert noise, keep resource cost under control, and catch production issues earlier. The important shift that comes as a result: the agent writing the code now has the same production view as the on-call engineer.

Grafana Cloud is the easiest way to get started with metrics, logs, traces, dashboards, and more. We have a generous forever-free tier and plans for every use case. Sign up for free now!

Tags

Related content