<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Introduction to the Grafana CLI on Grafana Labs</title><link>https://grafana.com/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/</link><description>Recent content in Introduction to the Grafana CLI on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/index.xml" rel="self" type="application/rss+xml"/><item><title>gcx CLI</title><link>https://grafana.com/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/gcx/</link><pubDate>Tue, 02 Jun 2026 16:22:08 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/gcx/</guid><content><![CDATA[&lt;h1 id=&#34;overview-of-the-gcx-cli&#34;&gt;Overview of the &lt;code&gt;gcx&lt;/code&gt; CLI&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;The Grafana CLI &lt;code&gt;gcx&lt;/code&gt; is available in &lt;a href=&#34;/docs/release-life-cycle/&#34;&gt;public preview&lt;/a&gt; for Grafana Cloud and Grafana OSS/Enterprise v12 or later. Older Grafana versions are not supported.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;gcx&lt;/code&gt; is under development.&lt;/strong&gt; Documentation and support is available based on the different tiers but might be limited to enablement, configuration, and some troubleshooting. No SLAs are provided.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;/help/&#34;&gt;Contact Grafana&lt;/a&gt; for support or to report any issues you encounter and help us improve this feature.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;gcx&lt;/code&gt; is a single CLI that allows you and your AI coding agent structured access to both Grafana (dashboards, folders, alert rules, data sources) and Grafana Cloud products such as Synthetic Monitoring, K6, Fleet Management, Incidents, or Adaptive Telemetry.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;gcx&lt;/code&gt; ships with a suite of agent skills for common workflows like alert investigation, root-cause analysis, dashboard GitOps, SLO management, and observability setup. It natively supports agentic workflows and it&amp;rsquo;s integrated with Grafana Assistant, combining the previously fragmented user experience into one single tool.&lt;/p&gt;
&lt;h2 id=&#34;benefits-of-gcx&#34;&gt;Benefits of &lt;code&gt;gcx&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Among others, &lt;code&gt;gcx&lt;/code&gt; provides the following benefits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Manage Grafana OSS/Enterprise and Grafana Cloud:&lt;/strong&gt; Use a single tool for dashboards, alerting, SLOs, on-call, synthetic checks, load testing, and more.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GitOps&lt;/strong&gt;: Pull resources to files, version in Git, or push back with full round-trip fidelity.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SRE&lt;/strong&gt;: Ensure system performance by monitoring telemetry and root-causing incidents.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Observability as code:&lt;/strong&gt; &lt;code&gt;gcx&lt;/code&gt; can scaffold Go projects, import existing dashboards, lint with Rego rules, or live-reload development servers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automation:&lt;/strong&gt; &lt;code&gt;gcx&lt;/code&gt; uses JSON/YAML output, structured errors, and predictable exit codes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multi-environment:&lt;/strong&gt; Use named contexts to switch between development, staging, and production environments.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AI agent friendly:&lt;/strong&gt; Agent mode auto-detected for Claude Code, Copilot, Cursor, and other.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;compatibility&#34;&gt;Compatibility&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;gcx&lt;/code&gt; is compatible with any agentic coding tool.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;gcx&lt;/code&gt; works across a wide range of Grafana product offerings. Feature availability depends on your Grafana deployment. For more information, refer to the &lt;a href=&#34;https://github.com/grafana/gcx#compatibility&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Compatibility matrix&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;migrate-from-grafanactl&#34;&gt;Migrate from &lt;code&gt;grafanactl&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;If you want to migrate from &lt;code&gt;grafanctl&lt;/code&gt; to &lt;code&gt;gcx&lt;/code&gt;, search-and-replace &lt;code&gt;grafanactl&lt;/code&gt; with &lt;code&gt;gcx&lt;/code&gt;. For &lt;code&gt;grafanactl resources serve&lt;/code&gt;, use &lt;code&gt;gcx dev serve&lt;/code&gt; instead.&lt;/p&gt;
&lt;h2 id=&#34;learn-more&#34;&gt;Learn more&lt;/h2&gt;
&lt;p&gt;Refer to the &lt;a href=&#34;https://github.com/grafana/gcx&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;gcx&lt;/code&gt; repository&lt;/a&gt; in GitHub for more information on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Installation and configuration&lt;/li&gt;
&lt;li&gt;How to manage resources, including dashboards-as-code&lt;/li&gt;
&lt;li&gt;CLI command reference&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="overview-of-the-gcx-cli">Overview of the &lt;code>gcx&lt;/code> CLI&lt;/h1>
&lt;div class="admonition admonition-caution">&lt;blockquote>&lt;p class="title text-uppercase">Caution&lt;/p>&lt;p>The Grafana CLI &lt;code>gcx&lt;/code> is available in &lt;a href="/docs/release-life-cycle/">public preview&lt;/a> for Grafana Cloud and Grafana OSS/Enterprise v12 or later. Older Grafana versions are not supported.&lt;/p></description></item><item><title>Install and set up the grafanactl CLI</title><link>https://grafana.com/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/grafanactl/</link><pubDate>Tue, 28 Apr 2026 08:48:36 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/grafanactl/</guid><content><![CDATA[&lt;h1 id=&#34;install-and-set-up-the-grafanactl-cli&#34;&gt;Install and set up the &lt;code&gt;grafanactl&lt;/code&gt; CLI&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;&lt;code&gt;grafanactl&lt;/code&gt; is being deprecated, and we&amp;rsquo;re bringing all our learning and experience into the new, improved CLI tool 
    &lt;a href=&#34;/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/gcx/&#34;&gt;&lt;code&gt;gcx&lt;/code&gt;&lt;/a&gt;. The &lt;code&gt;grafanactl&lt;/code&gt; repository in GitHub will be archived on June 1, 2026.&lt;/p&gt;
&lt;p&gt;To migrate from &lt;code&gt;grafanactl&lt;/code&gt; to &lt;code&gt;gcx&lt;/code&gt;, search-and-replace &lt;code&gt;grafanactl&lt;/code&gt; with &lt;code&gt;gcx&lt;/code&gt;. For &lt;code&gt;grafanactl resources serve&lt;/code&gt;, use &lt;code&gt;gcx dev serve&lt;/code&gt; instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;grafanactl&lt;/code&gt; command-line tool allows you to authenticate, manage multiple environments, and perform administrative tasks through the Grafana REST API, all from the terminal. It&amp;rsquo;s available for Grafana OSS, Enterprise, and Cloud.&lt;/p&gt;
&lt;h2 id=&#34;install-the-grafana-cli-grafanactl&#34;&gt;Install the Grafana CLI &lt;code&gt;grafanactl&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;You can install the project using one of the following supported methods:&lt;/p&gt;
&lt;h3 id=&#34;1-download-a-pre-built-binary&#34;&gt;1. Download a pre-built binary&lt;/h3&gt;
&lt;p&gt;Download the latest binary for your platform from the &lt;a href=&#34;https://github.com/grafana/grafanactl/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Releases page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Prebuilt binaries are available for a variety of operating systems and architectures. Visit the latest release page, and scroll down to the Assets section.&lt;/p&gt;
&lt;p&gt;To install the binary, follow the instructions below:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download the archive for the desired operating system and architecture&lt;/li&gt;
&lt;li&gt;Extract the archive&lt;/li&gt;
&lt;li&gt;Move the executable to the desired directory&lt;/li&gt;
&lt;li&gt;Ensure this directory is included in the PATH environment variable&lt;/li&gt;
&lt;li&gt;Verify that you have execute permission on the file&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;2-build-from-source&#34;&gt;2. Build from source&lt;/h3&gt;
&lt;p&gt;To build &lt;code&gt;grafanactl&lt;/code&gt; from source you must:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have &lt;code&gt;git&lt;/code&gt; installed&lt;/li&gt;
&lt;li&gt;Have &lt;code&gt;go&lt;/code&gt; v1.24 (or greater) installed&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;go install github.com/grafana/grafanactl/cmd/grafanactl@latest&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configure-grafanactl&#34;&gt;Configure &lt;code&gt;grafanactl&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;You can configure &lt;code&gt;grafanactl&lt;/code&gt; in two ways: using environment variables or through a configuration file.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Environment variables&lt;/strong&gt; are ideal for CI environments and support a single context. A full list of supported environment variables is available in the &lt;a href=&#34;https://github.com/grafana/grafanactl/blob/main/docs/reference/environment-variables/index.md#environment-variables-reference&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;reference documentation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configuration files&lt;/strong&gt; can manage multiple contexts, making it easier to switch between different Grafana instances.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Configuration items may change depending on your set-up. For example, use &lt;code&gt;org-id&lt;/code&gt; for self-managed Grafana, but use &lt;code&gt;stack-id&lt;/code&gt; for Grafana Cloud.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;configure-grafana-cli-with-environment-variables&#34;&gt;Configure Grafana CLI with environment variables&lt;/h3&gt;
&lt;p&gt;Grafana CLI communicates with Grafana via the REST API, which requires authentication credentials.&lt;/p&gt;
&lt;p&gt;At a minimum, set the URL of your Grafana instance and the organization ID:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;GRAFANA_SERVER=&amp;#39;http://localhost:3000&amp;#39; GRAFANA_ORG_ID=&amp;#39;1&amp;#39; grafanactl config check&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Depending on your authentication method, you may also need to set:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;a href=&#34;https://github.com/grafana/grafanactl/blob/main/docs/reference/environment-variables/index.md#grafana_token&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;token&lt;/a&gt; for a &lt;a href=&#34;/docs/grafana/latest/administration/service-accounts/&#34;&gt;Grafana service account&lt;/a&gt; (recommended)&lt;/li&gt;
&lt;li&gt;A &lt;a href=&#34;https://github.com/grafana/grafanactl/blob/main/docs/reference/environment-variables/index.md#grafana_user&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;username&lt;/a&gt; and &lt;a href=&#34;https://github.com/grafana/grafanactl/blob/main/docs/reference/environment-variables/index.md#grafana_password&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;password&lt;/a&gt; for basic authentication&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To persist your configuration, consider &lt;a href=&#34;#use-configuration-contexts&#34;&gt;creating a context&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;use-configuration-contexts&#34;&gt;Use configuration contexts&lt;/h4&gt;
&lt;p&gt;Contexts allow you to easily switch between multiple Grafana instances.&lt;/p&gt;
&lt;p&gt;By default, the CLI uses a context named &lt;code&gt;default&lt;/code&gt;. To configure it use:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;grafanactl config set contexts.default.grafana.server http://localhost:3000
grafanactl config set contexts.default.grafana.org-id 1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Authenticate with a service account token:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;grafanactl config set contexts.default.grafana.token service-account-token&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Or use basic authentication:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;grafanactl config set contexts.default.grafana.user admin
grafanactl config set contexts.default.grafana.password admin&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can define additional contexts in the same way:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;grafanactl config set contexts.staging.grafana.server https://staging.grafana.example
grafanactl config set contexts.staging.grafana.org-id 1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;In these examples, &lt;code&gt;default&lt;/code&gt; and &lt;code&gt;staging&lt;/code&gt; are the names of the contexts.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;configure-grafana-cli-with-configuration-files&#34;&gt;Configure Grafana CLI with configuration files&lt;/h3&gt;
&lt;p&gt;Grafana CLI stores its configuration in a YAML file. The CLI determines the configuration file location in the following order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If the &lt;code&gt;--config&lt;/code&gt; flag is provided, the specified file is used.&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;$XDG_CONFIG_HOME&lt;/code&gt; is set:
&lt;code&gt;$XDG_CONFIG_HOME/grafanactl/config.yaml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;$HOME&lt;/code&gt; is set:
&lt;code&gt;$HOME/.config/grafanactl/config.yaml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;$XDG_CONFIG_DIRS&lt;/code&gt; is set:
&lt;code&gt;$XDG_CONFIG_DIRS/grafanactl/config.yaml&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Use &lt;code&gt;grafanactl config check&lt;/code&gt; to display the configuration file currently in use.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;useful-commands&#34;&gt;Useful commands&lt;/h2&gt;
&lt;p&gt;Check the current configuration:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;grafanactl config check&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;This command is useful to troubleshoot your configuration.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;List all available contexts:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;grafanactl config list-contexts&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Switch to a specific context:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;grafanactl config use-context staging&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;View the full configuration:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;grafanactl config view&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="install-and-set-up-the-grafanactl-cli">Install and set up the &lt;code>grafanactl&lt;/code> CLI&lt;/h1>
&lt;div class="admonition admonition-caution">&lt;blockquote>&lt;p class="title text-uppercase">Caution&lt;/p>&lt;p>&lt;code>grafanactl&lt;/code> is being deprecated, and we&amp;rsquo;re bringing all our learning and experience into the new, improved CLI tool
&lt;a href="/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/gcx/">&lt;code>gcx&lt;/code>&lt;/a>. The &lt;code>grafanactl&lt;/code> repository in GitHub will be archived on June 1, 2026.&lt;/p></description></item></channel></rss>