Skip to content
Development
Skill

/import-dashboards

Converts existing Grafana dashboards to Go builder code via gcx (dashboards as code). Use to import, migrate, or reverse-engineer a live dashboard into code. For YAML/JSON resource files, use manage-dashboards.

From plugin
gcx
81024 skills1 agent

Claude Code

$ npx -y skills add grafana/gcx --skill import-dashboards --agent claude-code

SKILL.md

import-dashboards.SKILL.md
name: import-dashboards
description: >-
  Converts existing Grafana dashboards to Go builder code via gcx (dashboards as
  code). Use to import, migrate, or reverse-engineer a live dashboard into code.
  For YAML/JSON resource files, use manage-dashboards.

Import Dashboards as Code

Import existing dashboards from a Grafana instance and convert them to Go builder code using `gcx dev import`.

Prerequisites

1. gcx installed and configured with a Grafana connection (`gcx config check` should show a valid context) 2. The target Grafana instance must be reachable

Import Commands

Import All Dashboards

gcx dev import dashboards

Writes Go files to `imported/` (default). Each dashboard becomes a function returning `*resource.ManifestBuilder`.

Import a Specific Dashboard

gcx dev import dashboards/my-dashboard-uid

Import to a Custom Directory

gcx dev import dashboards --path src/grafana

Import Multiple Resource Types

gcx dev import dashboards folders

How It Works

Grafana Instance
    │
    ▼
gcx dev import dashboards/foo
    │
    ├── 1. Fetches resource via K8s API (/apis endpoint)
    ├── 2. Detects the resource API version
    ├── 3. Runs version-specific converter (JSON → SDK builder code)
    ├── 4. Wraps in resource.NewManifestBuilder()
    └── 5. Writes to imported/<snake_case_name>.go

The converter produces Go code using the grafana-foundation-sdk builder pattern — the same pattern used by `dev generate` and `dev scaffold`.

Output Format

Each imported file looks like:

package dashboards

import (
    "github.com/grafana/grafana-foundation-sdk/go/dashboardv2beta1"
    "github.com/grafana/grafana-foundation-sdk/go/resource"
)

func MyDashboard() *resource.ManifestBuilder {
    // ... builder code generated from the live dashboard
}

Workflow: Import → Edit → Push

# 1. Import from Grafana
gcx dev import dashboards --path internal/dashboards

# 2. Review and edit the generated code
#    (fix up builder calls, add variables, etc.)

# 3. Render manifests from the builders. In a gcx-scaffolded project,
#    `go run .` writes JSON manifests to ./resources
go run .

# 4. Push back to Grafana
gcx resources push

Common Issues

| Issue | Fix | |-------|-----| | "no converter found" | The resource's API version has no converter; the error message names the unsupported version | | Auth error (401/403) | Run `gcx config check` to verify credentials | | Empty import | The selector matched no resources; check UID with `gcx resources get dashboards` | | Build fails with `undefined: cog` (or another lowercase SDK identifier) | Older gcx versions omit SDK imports from generated files. Add the missing import `github.com/grafana/grafana-foundation-sdk/go/<pkg>` for each undefined identifier — `variants` is nested at `go/cog/variants`. Newer gcx emits complete imports | | Imported code doesn't compile for other reasons | Complex dashboards can produce converter output that needs manual fixup: build, read the first error, fix, repeat |

Read more
@grafana
Ships withgcx

gcx is Grafana in your terminal and your agentic coding environment. With gcx you don't guess, but check the actual data.

81024 skills1 agent
Get the whole plugin

Stars on GitHub

Momentum

stars in total
810
Star history of grafana/gcx on GitHub, a chart by star-history.com

Other skills on gcx.

agento11y-instrument

agento11y-instrument

Instruments a developer's own LLM app or repairs missing generations and empty Performance charts in Grafana Agent Observability.…

@grafana@grafanaInstall Skill
agento11y-prod-setup

agento11y-prod-setup

Sets up production evaluation for a deployed AI agent in Agent Observability: online eval rules and guards (redact PII, block…

@grafana@grafanaInstall Skill
agento11y-test-starter

agento11y-test-starter

Builds a starter offline test suite for an AI agent before it ships: test cases from its code, scoring advice, and a runner stub.…

@grafana@grafanaInstall Skill
agento11y

agento11y

Inspects and manages Grafana Agent Observability resources via gcx: conversations, generations, experiments, evaluators, rules,…

@grafana@grafanaInstall Skill
create-dashboard

create-dashboard

Designs and creates Grafana dashboards with gcx, with `gcx dashboards snapshot` as a visual feedback loop. Use to build a new…

@grafana@grafanaInstall Skill
debug-with-grafana

debug-with-grafana

Investigates application problems and incidents with Grafana metrics, logs, and traces via gcx: errors, latency, regressions,…

@grafana@grafanaInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about import-dashboards.

Which coding agents can use import-dashboards?
import-dashboards installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.