grafana/gcx
A CLI for managing Grafana and Grafana Cloud resources. Optimized for agentic usage.
gcx is a command-line tool (CLI) that brings Grafana — a platform for monitoring and observability — directly into your terminal or AI coding assistant. Instead of switching between browser tabs, you can query live metrics, check alerts, manage dashboards, and more, all from the command line or through an AI agent that runs shell commands.
What it does:
- Queries data: Run PromQL (metrics), LogQL (logs), and similar queries for traces and profiles directly from the terminal.
- Manages resources: Pull and push dashboards, folders, and alert rules as code (GitOps-style).
- Checks alerts and SLOs: List firing alerts, review service-level objectives, and investigate incidents.
- Works with Grafana Cloud products: Includes commands for SLOs, Synthetic Monitoring, IRM (incident response), k6 load testing, Fleet Management, and more — but only on Grafana Cloud.
- Integrates with AI agents: Ships a bundle of “skills” that let AI coding tools (like Claude Code, OpenAI Codex) investigate alerts, create dashboards, and fix issues using
gcxcommands.
Compatibility:
- Works with Grafana Cloud, Enterprise, and OSS (self-hosted) versions.
- Full support for Grafana 13+; Grafana 12 works but with limited features; versions below 12 are not supported.
- Cloud-only products (SLO, Synthetic Monitoring, etc.) require Grafana Cloud.
Installation:
- Quick script:
curl -fsSL https://raw.githubusercontent.com/grafana/gcx/main/scripts/install.sh | sh - Homebrew:
brew install gcx
Example usage:
gcx metrics query 'rate(http_requests_total[5m])' --since 1h
gcx alert rules list --state firing
gcx slo definitions list
Costs: gcx itself is free, but some Grafana Cloud products it interacts with (like Assistant, Synthetic Monitoring, k6) are billed based on usage. Queries and resource push/pull are not billed.
In short, gcx is a bridge between Grafana’s data and your terminal or AI assistant, making observability workflows faster and more scriptable.
Related
- Project
- Project
- Project
- Project