{
  "id": "grafanactl",
  "name": "grafanactl",
  "homepage": "https://grafana.com/docs/grafana/latest/as-code/observability-as-code/grafana-cli/grafanactl/",
  "description": "A command-line tool to authenticate, manage environments, and perform administrative tasks through the Grafana REST API.",
  "executables": [
    "grafanactl"
  ],
  "dotfiles": {
    "paths": [
      "[configHome]/grafanactl/config.yaml"
    ],
    "secret": [],
    "secret_paths": [
      {
        "file": "[configHome]/grafanactl/config.yaml",
        "format": "yaml",
        "match": {
          "key_path": [
            "contexts.*.grafana.token",
            "contexts.*.grafana.user",
            "contexts.*.grafana.password"
          ]
        }
      }
    ]
  },
  "commands": {
    "format": 1,
    "label": "grafanactl",
    "description": "Grafana CLI. Only 'resources pull' is offered here; other sub-commands are left out. The project is being deprecated in favour of gcx.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "subcommand": [
      {
        "path": [
          "resources",
          "pull"
        ],
        "label": "Pull resources from Grafana",
        "description": "Download dashboards, folders and other resources from the selected Grafana context to files on disk.",
        "source": [
          {
            "id": "docs",
            "kind": "manual",
            "url": "https://github.com/grafana/grafanactl/blob/main/docs/reference/cli/grafanactl_resources_pull.md",
            "revision": "main 2026-10-27",
            "evidence": "grafanactl resources pull [RESOURCE_SELECTOR]... [flags]\ngrafanactl resources pull dashboards folders\ngrafanactl resources pull dashboards/foo,bar\n      --include-managed   Include resources managed by tools other than grafanactl\n      --on-error string   How to handle errors during resource operations:\n                            ignore — continue processing all resources and exit 0\n                            fail   — continue processing all resources and exit 1 if any failed (default)\n                            abort  — stop on the first error and exit 1 (default \"fail\")\n  -o, --output string     Output format. One of: json, yaml (default \"json\")\n  -p, --path string       Path on disk in which the resources will be written (default \"./resources\")\n      --config string    Path to the configuration file to use\n      --context string   Name of the context to use\n      --no-color         Disable color output\n"
          }
        ],
        "field": [
          {
            "id": "selectors",
            "label": "Resource selectors",
            "description": "For example dashboards, dashboards/foo,bar or folders. Leave empty to pull everything.",
            "type": "string",
            "position": 0,
            "multiple": true,
            "sources": [
              "docs"
            ]
          },
          {
            "id": "context",
            "label": "Context",
            "description": "Name of the configured Grafana context to use.",
            "type": "string",
            "option": [
              "--context"
            ],
            "sources": [
              "docs"
            ]
          },
          {
            "id": "path",
            "label": "Output directory",
            "type": "path",
            "option": [
              "--path",
              "-p"
            ],
            "path": {
              "kind": "directory",
              "role": "output",
              "must_exist": false
            },
            "effect": "overwrite",
            "sources": [
              "docs"
            ]
          },
          {
            "id": "output",
            "label": "File format",
            "type": "enum",
            "option": [
              "--output",
              "-o"
            ],
            "choices": [
              {
                "value": "json",
                "label": "JSON"
              },
              {
                "value": "yaml",
                "label": "YAML"
              }
            ],
            "sources": [
              "docs"
            ]
          },
          {
            "id": "on_error",
            "label": "On error",
            "type": "enum",
            "option": [
              "--on-error"
            ],
            "choices": [
              {
                "value": "ignore",
                "label": "Ignore and exit 0"
              },
              {
                "value": "fail",
                "label": "Continue, exit 1 if any failed"
              },
              {
                "value": "abort",
                "label": "Stop at first error"
              }
            ],
            "sources": [
              "docs"
            ]
          },
          {
            "id": "include_managed",
            "label": "Include resources managed by other tools",
            "type": "boolean",
            "option": [
              "--include-managed"
            ],
            "sources": [
              "docs"
            ]
          },
          {
            "id": "config",
            "label": "Config file",
            "type": "path",
            "option": [
              "--config"
            ],
            "path": {
              "kind": "file",
              "role": "input",
              "must_exist": true
            },
            "sources": [
              "docs"
            ]
          },
          {
            "id": "no_color",
            "label": "Disable colour",
            "type": "boolean",
            "option": [
              "--no-color"
            ],
            "sources": [
              "docs"
            ]
          }
        ],
        "task": [
          {
            "id": "dashboards",
            "label": "Pull all dashboards",
            "set": {
              "selectors": [
                "dashboards"
              ]
            },
            "fields": [
              "selectors",
              "context",
              "path",
              "output"
            ],
            "required": []
          },
          {
            "id": "everything",
            "label": "Pull everything",
            "fields": [
              "context",
              "path",
              "output",
              "on_error"
            ],
            "required": []
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "selectors",
              "context",
              "path",
              "output"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "on_error",
              "include_managed",
              "config",
              "no_color"
            ]
          }
        ]
      }
    ]
  }
}
