Install the hadron CLI¶
hadron is the command-line interface to the Hadron platform — for humans
working in a terminal and for AI agents shelling out to it. This guide gets
it installed and authenticated. For the full command surface and output
contract, see the hadron CLI reference.
Install¶
Homebrew (macOS)¶
Release archives (macOS, Linux, Windows)¶
Download the archive for your platform from the
latest release,
verify it against checksums.txt, and put the hadron binary on your
PATH.
Go¶
Note
go install builds without the release version stamp, so
hadron version reports dev. Functionality is identical.
Linux / Debian (Go from official tarball)¶
On Debian and other Linux distributions, the system Go package can lag behind
what @latest needs. For a fresh Linux host, install the official Go toolchain
from the tarball:
# 1. Download and install the official Go toolchain (latest)
VER=$(curl -fsSL "https://go.dev/VERSION?m=text" | head -1) # e.g. go1.26.4
curl -fsSL -o /tmp/go.tgz "https://go.dev/dl/${VER}.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf /tmp/go.tgz
# 2. Add Go and the install target directory to your PATH
export PATH=/usr/local/go/bin:$HOME/go/bin:$PATH # GOPATH/bin defaults to ~/go/bin
# Persist for future shells by adding the above to ~/.bashrc, ~/.zshrc, etc.
# 3. Install the CLI
go install github.com/hadron-memory/hadron-cli/cmd/hadron@latest
# 4. (Optional) Make it available system-wide
sudo ln -sf "$HOME/go/bin/hadron" /usr/local/bin/hadron
Verify:
Sign in¶
Interactive OAuth (browser-based)¶
Opens your browser for OAuth; the token is stored in your OS keychain:
Headless hosts (SSH / remote servers): The OAuth callback redirects to
127.0.0.1 on your client machine, but the CLI listener is on the
host's 127.0.0.1, so the callback never reaches the CLI. Two workarounds:
-
Deliver the callback manually. The browser shows a redirect URL like
The CLI receives the code and completes the flow.http://127.0.0.1:53284/callback?code=...&state=.... Copy that URL and paste it intocurlon the host: -
Skip the browser entirely. Mint a token on your local machine and pipe it to the remote:
Personal access tokens (CI, scripts, agents)¶
For non-interactive contexts, use a personal access token. Mint one from the CLI
once you're signed in — hadron auth token create — or in the portal
(see Manage your API keys); the portal is optional:
hadron auth token create --label ci-deploy # mint; prints the raw key ONCE
export HADRON_TOKEN=hdr_user_... # env var, overrides stored tokens
# or store it once:
echo "$TOKEN" | hadron auth login --with-token
Note on headless hosts: There is no OS keychain on a headless server, so
stored tokens live in ~/.config/hadron/auth.json instead. The CLI falls back
automatically — nothing to configure.
Verify¶
The CLI talks to https://srv.hadronmemory.com by default. For a
self-hosted server:
For AI agents¶
Two options once the binary is installed:
- Tell the agent to run
hadron agentic-usage— the CLI prints its own complete agent contract (stable exit codes,--jsonoutput rules, recipes). - In Claude Code, install the skill plugin:
Next steps¶
- hadron CLI reference — commands, output contract, exit codes, URN rules.
- Manage your API keys — mint and revoke the tokens the CLI uses in non-interactive contexts.