grafana-cli
Skill8 starsChanged 6 months agoApache-2.0View on GitHub
Perform Grafana operations using the Grafana HTTP API via curl. Use for querying dashboards, datasources, alerts, and annotations.
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use the instance and rules below when constructing all Grafana API commands.
- Distinctive: line 12
Update the table below with your Grafana instance URLs and corresponding token file paths:
- Distinctive: line 19
If the target instance is unclear, ask the user before running any command.
- Very specific: line 37
All API calls use curl with the token read from the instance's token file (see instance table above):
- Distinctive: line 96
NEVER target any Grafana instance not listed in the instance table above.
- Distinctive: line 97
Update the instance table with your actual Grafana URLs before using this skill.
- Distinctive: line 98
NEVER print, display, log, or store the contents of any token file or credential value.
- Very specific: line 99
Always read the token inline with $(cat <TOKEN_FILE>) — never hardcode a token value in a command.
- Very specific: line 100
Always pass -s (silent) to curl to suppress progress output, and pipe through jq for readable output.
- Distinctive: line 101
NEVER run DELETE or destructive PUT/POST operations without explicit user instruction.
- Distinctive: line 102
If a dashboard UID, datasource ID, or folder UID is unfamiliar, look it up with a read-only call first.
- Distinctive: line 103
If the required token file does not exist, inform the user and stop.
- Very specific: line 104
All list endpoints may be paginated — check the response for page and perpage fields and iterate if needed.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Grafana CLI Skill
Use the instance and rules below when constructing all Grafana API commands.
Instances
Update the table below with your Grafana instance URLs and corresponding token file paths:
| Environment | Base URL | Token File |
| Production | https://<your-grafana-prod-url> | ~/.grafana/prod.token |
| Staging | https://<your-grafana-staging-url> | ~/.grafana/staging.token |
If the target instance is unclear, ask the user before running any command.
Prerequisites (one-time setup by user)
Generate a Grafana API token for each instance you intend to use and save it to the corresponding token file (see instance table above). Never print or display token values. Do not perform these steps yourself.
For each instance:
- Navigate to
<BASE_URL>→ Administration → Users and access → Service accounts → Add service account - Enter a display name and role, then click Create
- On the service account page, click Add service account token and copy the generated token
- Save it:
mkdir -p ~/.grafana && echo "<your-api-token>" > <TOKEN_FILE> && chmod 600 <TOKEN_FILE>Command Format
All API calls use curl with the token read from the instance's token file (see instance table above):
curl -s -H "Authorization: Bearer $(cat <TOKEN_FILE>)" \
"<BASE_URL>/api/<endpoint>" | jq .Example (production):
curl -s -H "Authorization: Bearer $(cat ~/.grafana/prod.token)" \
"https://<your-grafana-prod-url>/api/health" | jq .Available API Endpoints
Read-only (safe, no confirmation needed)
| Endpoint | Method | Description |
/api/org | GET | Get current organisation info |
/api/user | GET | Get current authenticated user |
/api/datasources | GET | List all datasources |
/api/datasources/<id> | GET | Get datasource by ID |
/api/dashboards/home | GET | Get the home dashboard |
/api/search?query=<term> | GET | Search dashboards and folders |
/api/dashboards/uid/<uid> | GET | Get dashboard by UID |
/api/folders | GET | List all folders |
/api/folders/<uid> | GET | Get folder by UID |
/api/alerts | GET | List legacy alerts |
/api/v1/provisioning/alert-rules | GET | List all alert rules |
/api/v1/provisioning/alert-rules/<uid> | GET | Get alert rule by UID |
/api/annotations | GET | List annotations |
/api/health | GET | Check Grafana health |
Mutating operations (confirm with user before running)
| Endpoint | Method | Description |
/api/dashboards/db | POST | Create or update a dashboard |
/api/folders | POST | Create a folder |
/api/folders/<uid> | PUT | Update a folder |
/api/annotations | POST | Create an annotation |
/api/annotations/<id> | PUT | Update an annotation |
/api/v1/provisioning/alert-rules | POST | Create an alert rule |
/api/v1/provisioning/alert-rules/<uid> | PUT | Update an alert rule |
Never run — requires explicit human approval
| Endpoint | Method | Reason |
/api/dashboards/uid/<uid> | DELETE | Irreversible dashboard deletion |
/api/folders/<uid> | DELETE | Deletes folder and all its dashboards |
/api/datasources/<id> | DELETE | Removes datasource used by dashboards |
/api/annotations/<id> | DELETE | Irreversible annotation deletion |
/api/v1/provisioning/alert-rules/<uid> | DELETE | Removes alert rule permanently |
/api/admin/users/<id> | DELETE | Deactivates a user account |
Rules
- NEVER target any Grafana instance not listed in the instance table above. If a URL references a different host, stop and ask the user to confirm.
- Update the instance table with your actual Grafana URLs before using this skill.
- NEVER print, display, log, or store the contents of any token file or credential value.
- Always read the token inline with
$(cat <TOKEN_FILE>)— never hardcode a token value in a command. - Always pass
-s(silent) tocurlto suppress progress output, and pipe throughjqfor readable output. - NEVER run DELETE or destructive PUT/POST operations without explicit user instruction.
- If a dashboard UID, datasource ID, or folder UID is unfamiliar, look it up with a read-only call first.
- If the required token file does not exist, inform the user and stop. Do not attempt to find or guess the token.
- All list endpoints may be paginated — check the response for
pageandperpagefields and iterate if needed.
In this repository54 other files it gives its agents.
- alibabacloud-cliSkill
- ansible-cliSkill
- appdynamics-cliSkill
- argocd-cliSkill
- aws-cliSkill
- aws-cloudwatch-cliSkill
- azure-cliSkill
- bash-lintingSkill
- betterstack-cliSkill
- bitbucket-cliSkill
- chef-cliSkill
- code-reviewSkill
- commit-codeSkill
- create-dockerfileSkill
- create-terraform-helm-upgrade-planSkill
- datadog-cliSkill
- digitalocean-cliSkill
- dockerfile-lintingSkill
- dynatrace-cliSkill
- elasticsearch-cliSkill
- gcp-cliSkill
- github-cliSkill
- gitlab-cliSkill
- go-lintingSkill
- grafana-loki-cliSkill
- graylog-cliSkill
- helm-cliSkill
- hetzner-cliSkill
- huaweicloud-cliSkill
- jaeger-cliSkill
- jenkins-cliSkill
- jira-and-confluence-cliSkill
- kibana-cliSkill
- kubernetes-cliSkill
- loggly-cliSkill
- maintenance-check-aws-eksSkill
- maintenance-create-ticket-on-jiraSkill
- ms-teams-cliSkill
- mysql-cliSkill
- newrelic-cliSkill
- oci-cliSkill
- packer-cliSkill
- papertrail-cliSkill
- postgresql-cliSkill
- prometheus-cliSkill
- python-lintingSkill
- rollbar-cliSkill
- salesforce-cliSkill
- sentry-cliSkill
- slack-cliSkill
- splunk-cliSkill
- terraform-cliSkill
- terraform-lintingSkill
- vault-cliSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

