Installation
Install the prebuilt binary or build Grafana CLI from source.
Install script (recommended)
Installs the latest prebuilt binary for your OS/arch. No Go toolchain is required:
curl -sSfL https://raw.githubusercontent.com/piyush-gambhir/grafana-cli/main/install.sh | shPin a version or change the install directory:
curl -sSfL https://raw.githubusercontent.com/piyush-gambhir/grafana-cli/main/install.sh | VERSION=0.2.4 sh
curl -sSfL https://raw.githubusercontent.com/piyush-gambhir/grafana-cli/main/install.sh | INSTALL_DIR=~/.local/bin shThe script installs to /usr/local/bin by default and asks for elevated
permissions when that directory is not writable.
Download a release manually
Prebuilt archives are attached to each
GitHub Release. Download
the archive for your OS and architecture, extract it, and put grafana on your
PATH:
# example (macOS arm64) — adjust the version/asset name
curl -sSfL https://github.com/piyush-gambhir/grafana-cli/releases/latest/download/grafana-cli_darwin_arm64.tar.gz | tar xz
sudo mv grafana /usr/local/bin/The install script expects assets named grafana-cli_<os>_<arch>.tar.gz, where
<os> is darwin or linux and <arch> is amd64 or arm64.
Build from source
Building locally requires Go:
git clone https://github.com/piyush-gambhir/grafana-cli.git
cd grafana-cli/cli-go
make installThe binary is grafana.
Verify
grafana version