import-dashboards

Convert existing Grafana dashboards into Go builder code using gcx dev import.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually recreating existing Grafana dashboards as code is tedious and error-prone. This Skill reverse-engineers live dashboards from a Grafana instance and generates Go builder code, enabling dashboard-as-code workflows without rewriting panels by hand. ## Core Features & Use Cases - Bulk or Targeted Import: Import all dashboards, a single dashboard by UID, or multiple resource types (dashboards and folders) into a chosen output directory. - Version-Aware Conversion: Detects the dashboard API version (v0alpha1, v1beta1, v2beta1) and runs the matching converter to produce grafana-foundation-sdk builder code. - Import-Edit-Push Workflow: Review and refine the generated Go code, then push changes back to Grafana with gcx resources push. - Use Case: A platform team adopting infrastructure-as-code imports their production Grafana dashboards, commits the generated Go files to version control, and manages future dashboard changes through code review. ## Quick Start Import all dashboards from my connected Grafana instance into Go code under the imported directory using gcx dev import.

Frequently Asked Questions about import-dashboards

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

FAQPage Schema
How do I import Grafana dashboards as Go code?

Run gcx dev import dashboards to convert all dashboards from your connected Grafana instance into Go files. Each dashboard becomes a function returning a ManifestBuilder using the grafana-foundation-sdk builder pattern, written to the imported directory by default.

How to import a single Grafana dashboard by UID?

Use gcx dev import dashboards/<dashboard-uid> to import one specific dashboard. You can find available UIDs by running gcx resources get dashboards, and redirect output with the --path flag to a custom directory.

Which Grafana dashboard API versions does gcx import support?

The importer supports v0alpha1, v1beta1, and v2beta1 dashboard API versions. It auto-detects the version from the K8s API response and runs the matching converter; unsupported versions produce a no converter found error.

Why does gcx dashboard import return an auth error?

A 401 or 403 error means your gcx credentials are invalid or lack permissions. Run gcx config check to verify your Grafana connection context and credentials before retrying the import.

What if the imported dashboard Go code does not compile?

Complex dashboards can produce converter output requiring manual fixes. Review the generated builder calls, adjust unsupported constructs by hand, then push the corrected code back with gcx resources push.