Terminal
Terminal/Skill
Creates a new Go project that manages Grafana dashboards and resources as code, using the gcx scaffold command.
By Grafana Labs
Works with
npx skills add grafana/gcx --skill scaffold-projectScaffold a new Go project for managing Grafana resources as code using
gcx dev scaffold.
Verify gcx is installed:
gcx --version
If missing, see the setup-gcx skill.
gcx dev scaffold
Prompts for:
github.com/myorg/my-dashboardsgcx dev scaffold --project my-dashboards --go-module-path github.com/myorg/my-dashboards
my-dashboards/
├── .github/workflows/deploy.yaml # CI/CD workflow for gcx push
├── .gitignore
├── go.mod
├── main.go # Entrypoint — registers all resources
├── internal/
│ └── dashboards/
│ ├── all.go # Registry function returning all manifests
│ └── sample.go # Example dashboard using foundation-sdk builders
└── README.md
cd my-dashboards && go mod tidygcx config set stacks.default.grafana.server <URL>, gcx config set stacks.default.grafana.token <TOKEN>, and gcx config set contexts.default.stack defaultinternal/dashboards/sample.go or generate new stubs with gcx dev generategcx resources push| Issue | Fix |
|---|---|
go mod tidy fails | Ensure your Go toolchain meets the version required by the generated go.mod |
| Project name has spaces | Names are auto-kebab-cased; spaces become hyphens |
| Want to add alert rules | Create internal/alerts/ and use gcx dev generate alerts/my-rule.go |