gcx

Manage Grafana Cloud resources through the gcx CLI with kubectl-style commands.

1|Updated May 25, 2020
One-click install
npx skills add https://github.com/titaneric/dotfiles --skill gcx-titaneric
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gcx
Source: https://github.com/titaneric/dotfiles/tree/main/dot_agents/skills/gcx
Command: npx skills add https://github.com/titaneric/dotfiles --skill gcx-titaneric

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing Grafana Cloud resources across dashboards, alerts, SLOs, logs, metrics, and traces requires navigating many APIs and UIs. This Skill provides a unified, kubectl-style CLI workflow so you can inspect, query, and mutate any Grafana Cloud resource from the terminal with consistent verbs and structured output. ## Core Features & Use Cases - Unified Resource Management: CRUD operations for dashboards, datasources, alert rules, SLOs, synthetic checks, on-call schedules, incidents, k6 tests, and fleet pipelines via the gcx resources and dedicated command groups. - Signal Queries: Run PromQL, LogQL, Pyroscope, and Tempo trace queries directly, with LLM-friendly compact output for trace inspection. - Safe Mutation Workflow: Verify context, read current state, build from schemas/examples, preview with --dry-run, apply, and verify changes. - Grafana Assistant Integration: Use gcx assistant prompt and investigations for cross-signal root cause analysis when deterministic queries are not enough. - Use Case: An on-call engineer sees a firing alert, runs gcx alert instances list --state firing, queries related traces with gcx traces query, then asks the Assistant why the latency spiked — all without leaving the terminal. ## Quick Start Ask the AI to list all firing alert instances in your current Grafana Cloud context using gcx, then investigate the root cause.

Frequently Asked Questions about gcx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage Grafana Cloud dashboards from the command line?

Use the gcx resources group: `gcx resources get dashboards` to list, `gcx resources push` to create or update from local files, and `gcx resources pull` to export. Discover schemas with `gcx resources schemas dashboards` before building payloads.

How do I run PromQL or LogQL queries against Grafana Cloud?

Use `gcx metrics query -d <datasource-uid> 'up'` for PromQL and `gcx logs query -d <uid> '{app="foo"}'` for LogQL. These signal-specific commands handle datasource resolution automatically and are preferred over raw datasource queries.

How do I safely change Grafana Cloud resources without breaking production?

Follow the safe mutation workflow: verify the active context with `gcx config check`, read current state, build payloads from `gcx resources schemas` and `examples`, preview with `--dry-run`, apply, then re-read the resource to confirm the change.

When should I use the Grafana Assistant instead of direct gcx queries?

Use deterministic commands when you know the exact query, since they are faster and cheaper. Use `gcx assistant prompt` or investigations when you need cross-signal root cause analysis or do not know which metrics and labels exist.

Does gcx support multiple Grafana Cloud environments?

Yes, gcx uses named contexts like kubectl. Run `gcx config current-context` to see the active one, `gcx config use-context <name>` to switch, or pass `--context <name>` on any command to target a specific environment without switching.