import-dashboards
/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.
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
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.
Original author 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.
How it works
- Prerequisites
- Import Commands
- How It Works
- Output Format
- Workflow: Import → Edit → Push
- Common Issues
SKILL.md preview
---
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
```bash
gcx dev import dashboards
```
Writes Go files to `imported/` (default). Each dashboard becomes a function
returning `*resource.ManifestBuilder`.
### Import a Specific Dashboard
```bash
gcx dev import dashboards/my-dashboard-uid
```
### Import to a Custom Directory
```bash
gcx dev import dashboards --path src/grafana
```
### Import Multiple Resource Types
```bash
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:
```go
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
```bash
# 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 |
Versions
The database has no other skills named import-dashboards.
Database snapshot: 13.11.2026 · package version 25a7585d1e8d (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Similar skills
- 100create-dashboard
Designs and creates Grafana dashboards with gcx, with `gcx dashboards snapshot` as a visual feedback loop. Use to build a new dashboard, add panels, variables, or annotations, or redesign a dashboard. Not for inventory, audit, or pull/push of existing dashboards (use manage-dashboards). - 100scaffold-project
Scaffolds a new Go project for Grafana resources as code with `gcx dev scaffold`. Use to start a new dashboards-as-code repo or gcx project. Not for installing or connecting gcx (use setup-gcx). - 100grafana-dashboards-and-alerts
Production Grafana dashboards and unified alerting. Use when editing dashboard JSON or PromQL, building RED dashboards, authoring alert rules and contact-point routing, or provisioning dashboards as code. - 100grafana-dashboards
Create and manage production Grafana dashboards for real-time visualization of system and application metrics. Use when building monitoring dashboards, visualizing metrics, or creating operational ... - 100provisioning
Grafana provisioning across all delivery methods: file provisioning YAML (datasources, dashboards, alerting), Kubernetes-style HTTP API, gcx CLI (replacing grafanactl), Terraform provider, Foundation SDK, Git Sync. Invoke whenever task involves any interaction with Grafana… - 100grafana-helper
Use Grafana's GCX CLI for dashboards, datasources, Prometheus metrics, Loki logs, Tempo traces, alert rules, and Grafana resource operations. Trigger for Grafana, GCX, dashboards, PromQL, LogQL, metrics, logs, traces, Tempo, alert rules, or observability investigations.