<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>gcx CLI on Grafana Labs</title><link>https://grafana.com/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/gcx/</link><description>Recent content in gcx 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/gcx/index.xml" rel="self" type="application/rss+xml"/><item><title>Introduction to gcx</title><link>https://grafana.com/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/gcx/overview/</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/overview/</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 creation and 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 gcx</title><link>https://grafana.com/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/gcx/installation/</link><pubDate>Fri, 15 May 2026 16:15:40 +0100</pubDate><guid>https://grafana.com/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/gcx/installation/</guid><content><![CDATA[&lt;h1 id=&#34;install-gcx&#34;&gt;Install &lt;code&gt;gcx&lt;/code&gt;&lt;/h1&gt;
&lt;h2 id=&#34;quick-install-using-the-script&#34;&gt;Quick install using the script&lt;/h2&gt;
&lt;p&gt;The fastest way to install &lt;code&gt;gcx&lt;/code&gt; on Linux or macOS is with the script:&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;sh&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-sh&#34;&gt;curl -fsSL https://raw.githubusercontent.com/grafana/gcx/main/scripts/install.sh | sh&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The script:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Detects your operating system and architecture.&lt;/li&gt;
&lt;li&gt;Downloads the latest release from GitHub&lt;/li&gt;
&lt;li&gt;Verifies the SHA-256 checksum.&lt;/li&gt;
&lt;li&gt;Installs the binary to &lt;code&gt;~/.local/bin&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;installer-configuration-options&#34;&gt;Installer configuration options&lt;/h3&gt;
&lt;p&gt;Use these environment variables to customize the install script:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Environment variable&lt;/th&gt;
              &lt;th&gt;Default&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;INSTALL_DIR&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;$HOME/.local/bin&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Directory to install the binary into&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;VERSION&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;latest&lt;/td&gt;
              &lt;td&gt;Specific version to install (e.g., &lt;code&gt;0.2.4&lt;/code&gt;)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;GITHUB_TOKEN&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;unset&lt;/td&gt;
              &lt;td&gt;GitHub token for API requests (avoids rate limits)&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;examples&#34;&gt;Examples&lt;/h3&gt;
&lt;p&gt;Install a specific version:&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;sh&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-sh&#34;&gt;curl -fsSL https://raw.githubusercontent.com/grafana/gcx/main/scripts/install.sh | VERSION=0.2.4 sh&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Install to &lt;code&gt;/usr/local/bin&lt;/code&gt;:&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;sh&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-sh&#34;&gt;curl -fsSL https://raw.githubusercontent.com/grafana/gcx/main/scripts/install.sh | INSTALL_DIR=/usr/local/bin sh&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;uninstall&#34;&gt;Uninstall&lt;/h3&gt;
&lt;p&gt;To remove &lt;code&gt;gcx&lt;/code&gt;, delete the binary:&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;sh&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-sh&#34;&gt;rm ~/.local/bin/gcx&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;install-gcx-with-homebrew-macos-and-linux&#34;&gt;Install &lt;code&gt;gcx&lt;/code&gt; with Homebrew (macOS and Linux)&lt;/h2&gt;
&lt;p&gt;To install &lt;code&gt;gcx&lt;/code&gt; with Homebrew run:&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;shell&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-shell&#34;&gt;brew install grafana/grafana/gcx&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To upgrade an existing installation:&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;shell&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-shell&#34;&gt;brew upgrade grafana/grafana/gcx&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Homebrew builds &lt;code&gt;gcx&lt;/code&gt; from source on your machine, as it pulls &lt;code&gt;go&lt;/code&gt; as a build dependency.
The first install usually takes 30 to 60 seconds, and later upgrades reuse the Homebrew download cache.&lt;/p&gt;
&lt;p&gt;This option avoids macOS Gatekeeper because it doesn&amp;rsquo;t download a prebuilt binary. You
won&amp;rsquo;t need to work around notarisation.&lt;/p&gt;
&lt;h2 id=&#34;install-a-prebuilt-binary&#34;&gt;Install a prebuilt binary&lt;/h2&gt;
&lt;p&gt;Prebuilt binaries are available for a variety of systems and architectures. Refer to the &lt;a href=&#34;https://github.com/grafana/gcx/releases/latest&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;release versions on GitHub&lt;/a&gt; for more details.&lt;/p&gt;
&lt;p&gt;To install a prebuilt binary:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download the archive for the operating system and architecture you need.&lt;/li&gt;
&lt;li&gt;Extract the archive.&lt;/li&gt;
&lt;li&gt;Move the executable to the directory where you want to keep it.&lt;/li&gt;
&lt;li&gt;Make sure that directory is in your &lt;code&gt;PATH&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Make sure the file has execute permission.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you use macOS, a manually downloaded binary might be blocked by Gatekeeper.
For more information, refer to &lt;a href=&#34;#macos-gatekeeper-and-killed-9&#34;&gt;macOS Gatekeeper and killed: 9&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;install-gcx-from-source&#34;&gt;Install &lt;code&gt;gcx&lt;/code&gt; from source&lt;/h2&gt;
&lt;p&gt;To install &lt;code&gt;gcx&lt;/code&gt; with Go, you need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://git-scm.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;git&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://go.dev/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;go&lt;/code&gt;&lt;/a&gt; 1.24 or later.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To install, run:&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;shell&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-shell&#34;&gt;go install github.com/grafana/gcx/cmd/gcx@latest&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;macos-gatekeeper-and-killed-9&#34;&gt;macOS Gatekeeper and killed 9&lt;/h2&gt;
&lt;p&gt;macOS quarantines any downloaded binary by default. Since &lt;code&gt;gcx&lt;/code&gt; release binaries are not yet Apple-notarised, macOS may block it the first time you run it. If this happens, you&amp;rsquo;ll see one of these two symptoms:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Intel macOS&lt;/strong&gt;: A dialog says, &lt;em&gt;&amp;ldquo;Apple could not verify &amp;lsquo;gcx&amp;rsquo; is free of malware…&amp;rdquo;&lt;/em&gt;, and the binary doesn&amp;rsquo;t run.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Apple Silicon (M-series) macOS&lt;/strong&gt;: The binary exits immediately with &lt;code&gt;killed: 9&lt;/code&gt; and no visible dialog.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Homebrew users are not affected&lt;/strong&gt;. Since it compiles &lt;code&gt;gcx&lt;/code&gt; from source on your machine, no pre-built binary is downloaded and no &lt;code&gt;xattr&lt;/code&gt; is set.&lt;/p&gt;
&lt;h3 id=&#34;bypass-the-macos-gatekeeper&#34;&gt;Bypass the macOS gatekeeper&lt;/h3&gt;
&lt;p&gt;In manual downloads, bypass this by clearing the &lt;code&gt;xattr&lt;/code&gt; and ad-hoc sign the binary so Apple Silicon accepts it:&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;sh&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-sh&#34;&gt;xattr -d com.apple.quarantine &amp;#34;$(command -v gcx)&amp;#34; 2&amp;gt;/dev/null || true
codesign --sign - --force &amp;#34;$(command -v gcx)&amp;#34;   # required on Apple Silicon&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Next, run &lt;code&gt;gcx --version&lt;/code&gt; again; subsequent invocations should succeed without the block.&lt;/p&gt;
&lt;p&gt;Note that these steps will no longer be necessary once &lt;code&gt;gcx&lt;/code&gt; release binaries are Apple-notarised.&lt;/p&gt;
]]></content><description>&lt;h1 id="install-gcx">Install &lt;code>gcx&lt;/code>&lt;/h1>
&lt;h2 id="quick-install-using-the-script">Quick install using the script&lt;/h2>
&lt;p>The fastest way to install &lt;code>gcx&lt;/code> on Linux or macOS is with the script:&lt;/p>
&lt;div class="code-snippet ">&lt;div class="lang-toolbar">
&lt;span class="lang-toolbar__item lang-toolbar__item-active">sh&lt;/span>
&lt;span class="code-clipboard">
&lt;button x-data="app_code_snippet()" x-init="init()" @click="copy()">
&lt;img class="code-clipboard__icon" src="/media/images/icons/icon-copy-small-2.svg" alt="Copy code to clipboard" width="14" height="13">
&lt;span>Copy&lt;/span>
&lt;/button>
&lt;/span>
&lt;div class="lang-toolbar__border">&lt;/div>
&lt;/div>&lt;div class="code-snippet ">
&lt;pre data-expanded="false">&lt;code class="language-sh">curl -fsSL https://raw.githubusercontent.com/grafana/gcx/main/scripts/install.sh | sh&lt;/code>&lt;/pre>
&lt;/div>
&lt;/div>
&lt;p>The script:&lt;/p></description></item><item><title>Configure gcx</title><link>https://grafana.com/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/gcx/configuration/</link><pubDate>Fri, 15 May 2026 16:15:40 +0100</pubDate><guid>https://grafana.com/docs/grafana/v13.0/as-code/observability-as-code/grafana-cli/gcx/configuration/</guid><content><![CDATA[&lt;h1 id=&#34;configure-gcx&#34;&gt;Configure &lt;code&gt;gcx&lt;/code&gt;&lt;/h1&gt;
&lt;p&gt;You can configure &lt;code&gt;gcx&lt;/code&gt; with a configuration file or using environment variables.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A configuration file can store multiple contexts, which makes it easier to switch between Grafana instances. Check the &lt;a href=&#34;https://github.com/grafana/gcx/tree/main/docs/reference/configuration/index.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;configuration file reference documentation&lt;/a&gt; for details on all available configuration options.&lt;/li&gt;
&lt;li&gt;Environment variables describe a single context, so they work best in CI environments. Refer to &lt;a href=&#34;#configure-gcx-with-environment-variables&#34;&gt;Configure &lt;code&gt;gcx&lt;/code&gt; with environment variables &lt;/a&gt; for more information.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;understand-the-gcx-configuration-file-in-use&#34;&gt;Understand the &lt;code&gt;gcx&lt;/code&gt; configuration file in use&lt;/h2&gt;
&lt;p&gt;Run &lt;code&gt;gcx config check&lt;/code&gt; to display the configuration file currently in use.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;gcx&lt;/code&gt; stores its configuration in a YAML file. Configuration is prioritized in this order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If the &lt;code&gt;--config&lt;/code&gt; flag is set, then that file will be loaded. No other location will be considered.&lt;/li&gt;
&lt;li&gt;If the &lt;code&gt;$XDG_CONFIG_HOME&lt;/code&gt; environment variable is set, then it will be used: &lt;code&gt;$XDG_CONFIG_HOME/gcx/config.yaml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If the &lt;code&gt;$HOME&lt;/code&gt; environment variable is set, then it will be used: &lt;code&gt;$HOME/.config/gcx/config.yaml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If the &lt;code&gt;$XDG_CONFIG_DIRS&lt;/code&gt; environment variable is set, then it will be used: &lt;code&gt;$XDG_CONFIG_DIRS/gcx/config.yaml&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;define-contexts&#34;&gt;Define contexts&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;gcx&lt;/code&gt; supports multiple contexts so you can switch between instances. By default, it uses the &lt;code&gt;default&lt;/code&gt; context.&lt;/p&gt;
&lt;p&gt;To configure the &lt;code&gt;default&lt;/code&gt; 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;shell&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-shell&#34;&gt;gcx config set contexts.default.grafana.server http://localhost:3000

# Set org-id when using OSS/Enterprise - skip when targeting Grafana Cloud
gcx config set contexts.default.grafana.org-id 1

# Authenticate with a service account token
gcx config set contexts.default.grafana.token service-account-token

# Or alternatively, use basic authentication
gcx config set contexts.default.grafana.user admin
gcx config set contexts.default.grafana.password admin&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To create another context, use the same pattern:&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;shell&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-shell&#34;&gt;gcx config set contexts.staging.grafana.server https://staging.grafana.example
gcx config set contexts.staging.grafana.org-id 1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Note that in these examples, &lt;code&gt;default&lt;/code&gt; and &lt;code&gt;staging&lt;/code&gt; are the context names.&lt;/p&gt;
&lt;h2 id=&#34;useful-commands&#34;&gt;Useful commands&lt;/h2&gt;
&lt;p&gt;Use these commands to check the 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;shell&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-shell&#34;&gt;gcx config check&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;List existing 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;shell&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-shell&#34;&gt;gcx config list-contexts&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Switch to a different 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;shell&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-shell&#34;&gt;gcx config use-context staging&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;See the entire 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;shell&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-shell&#34;&gt;gcx config view&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configure-gcx-with-environment-variables&#34;&gt;Configure &lt;code&gt;gcx&lt;/code&gt; with environment variables&lt;/h2&gt;
&lt;p&gt;Every supported environment variable is listed in our &lt;a href=&#34;https://github.com/grafana/gcx/tree/main/docs/reference/environment-variables/index.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;reference documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Since &lt;code&gt;gcx&lt;/code&gt; connects to Grafana through the REST API, you must configure authentication credentials. At minimum, set the Grafana URL and 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;shell&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-shell&#34;&gt;GRAFANA_SERVER=&amp;#39;http://localhost:3000&amp;#39; GRAFANA_ORG_ID=&amp;#39;1&amp;#39; gcx config check&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Depending on your authentication method, also set one of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you use a &lt;a href=&#34;/docs/grafana/latest/administration/service-accounts/&#34;&gt;Grafana service account&lt;/a&gt; (recommended), set a &lt;a href=&#34;https://github.com/grafana/gcx/tree/main/docs/reference/environment-variables/index.md#grafana_token&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;token&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If you use basic authentication, set a &lt;a href=&#34;https://github.com/grafana/gcx/tree/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 a &lt;a href=&#34;https://github.com/grafana/gcx/tree/main/docs/reference/environment-variables/index.md#grafana_password&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;password&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After you configure authentication, you can start using &lt;code&gt;gcx&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you want to persist this configuration, &lt;a href=&#34;#define-contexts&#34;&gt;create a context&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-gcx">Configure &lt;code>gcx&lt;/code>&lt;/h1>
&lt;p>You can configure &lt;code>gcx&lt;/code> with a configuration file or using environment variables.&lt;/p>
&lt;ul>
&lt;li>A configuration file can store multiple contexts, which makes it easier to switch between Grafana instances. Check the &lt;a href="https://github.com/grafana/gcx/tree/main/docs/reference/configuration/index.md" target="_blank" rel="noopener noreferrer">configuration file reference documentation&lt;/a> for details on all available configuration options.&lt;/li>
&lt;li>Environment variables describe a single context, so they work best in CI environments. Refer to &lt;a href="#configure-gcx-with-environment-variables">Configure &lt;code>gcx&lt;/code> with environment variables &lt;/a> for more information.&lt;/li>
&lt;/ul>
&lt;h2 id="understand-the-gcx-configuration-file-in-use">Understand the &lt;code>gcx&lt;/code> configuration file in use&lt;/h2>
&lt;p>Run &lt;code>gcx config check&lt;/code> to display the configuration file currently in use.&lt;/p></description></item></channel></rss>