Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/ai-tools/gcx.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/ai-tools/gcx/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
gcx CLI
Overview
gcx is the Grafana CLI that allows you and your AI coding agent to work with Grafana Cloud, Grafana Enterprise, and Grafana OSS.
gcx is designed to be used in common scenarios such as authentication against Grafana, query telemetry, inspect and manage resources, and automate observability workflows as code.
It’s also integrated with Grafana Assistant, combining the previously fragmented user experience into one single tool.
Get started
Note
Refer to the
gcxrepository in GitHub for the source code, architecture information, and contributor documentation.
- Introduction to gcx
What gcx is, what it costs, which Grafana versions it works with, and how its documentation is organized. - Install gcx
Install `gcx` with the quick installer, Homebrew, Windows, a prebuilt binary, or a container. - Authenticate gcx
Sign in with browser OAuth, a service account token, or basic authentication. - Configure gcx
Set up contexts with the configuration file or environment variables. - Roles and permissions
Roles and access policy scopes that `gcx` commands need, and how to fix authorization errors. - Log in to gcx
Create or re-authenticate a gcx context with gcx login, and troubleshoot common login errors. - Work with your resources
Grafana and Grafana Cloud resources you can manage with gcx, and the commands to use for each. - User guides
gcx user guides. - Use gcx with AI agents
How gcx behaves when an AI coding agent runs it, and how to set up skills, sign-in, destructive operations, detection, and output for agents. - Usage statistics
What `gcx` reports to Grafana Labs, and how to opt out. - Costs and billing
Which gcx commands operate billable Grafana Cloud products, and which do not. - Keychain credential storage
How `gcx` stores credentials in your operating system's keychain, and when it falls back to plaintext. - CLI reference
Complete gcx command, flag, and environment variable reference. - Migrate your gcx configuration
Move a legacy `gcx` configuration to the version 1 format.
Was this page helpful?
Related resources from Grafana Labs


