Glassnode CLI
The Glassnode CLI (gn) is a command-line interface for the Glassnode API. Use it to list assets and metrics, fetch data, and integrate with scripts or AI assistants via the optional skill. To see a practical demonstration of how the CLI can be utilized in agentic workflows, check out the article on Using Glassnode Data with Agents.
Installation
Install script (recommended)
Linux / macOS
curl -sSL https://raw.githubusercontent.com/glassnode/glassnode-cli/main/install.sh | bashThis installs the latest release to /usr/local/bin (uses sudo if needed). To install to a custom directory:
INSTALL_DIR=~/bin curl -sSL https://raw.githubusercontent.com/glassnode/glassnode-cli/main/install.sh | bashWindows (PowerShell)
irm https://raw.githubusercontent.com/glassnode/glassnode-cli/main/install.ps1 | iexThis installs to %LOCALAPPDATA%\glassnode\bin and adds it to your user PATH if needed.
Manual download
Download the archive for your OS and architecture from Releases, extract it, then move the binary into your PATH and make it executable (chmod +x gn on Unix).
From source
go install github.com/glassnode/glassnode-cli@latestThe binary from go install is named glassnode-cli. To get the gn command, build with:
and put gn in your PATH.
Authentication
Set your API key so the CLI can access the Glassnode API. The CLI resolves the key in this order:
--api-keyflag (highest priority)GLASSNODE_API_KEYenvironment variable~/.gn/config.yamlconfiguration file
To persist the key in the config file:
See API Key for how to get your API key. API access is available on the Professional plan (full API) and the Advanced plan (Light API). API usage consumes API credits as with direct API calls.
Quick start
Add the CLI skill (AI assistants)
To let AI coding assistants (e.g. Cursor, Codex) use the Glassnode CLI and API knowledge, add the official skill:
After adding the skill, the assistant can run gn commands, discover metrics and assets, and follow CLI best practices when helping you work with Glassnode data.
For full usage, examples, and bulk metrics, see the Glassnode CLI repository.
Last updated