qn — Quicknode CLI
qn is a command-line interface for Quicknode, built around noun-verb commands that read naturally for both humans and agents. Manage endpoints, streams, webhooks, the KV store, teams, usage, and billing, with output in multiple formats for easy reading or scripting.
$ qn endpoint list
ID LABEL STATUS CHAIN/NETWORK TYPE MULTI
ep-1 production active ethereum/mainnet shared yes
ep-2 — paused solana/mainnet dedicated no
showing 1–2 of 2
$ qn endpoint list --wide
ID LABEL STATUS CHAIN/NETWORK TYPE MULTI HTTP WSS
ep-1 production active ethereum/mainnet shared yes https://ep-1.example —
ep-2 — paused solana/mainnet dedicated no https://ep-2.example —
showing 1–2 of 2
# LLM-optimized TOON format (non-TTY default)
$ qn endpoint list | cat
data[2]{id,name,label,status,chain,network,is_dedicated,is_flat_rate,http_url,wss_url,tags,is_multichain}:
"ep-1","ep-1","production",active,ethereum,mainnet,false,false,"https://ep-1.example",null,"prod, eu",false
"ep-2","ep-2",null,paused,solana,mainnet,true,false,"https://ep-2.example",null,"",false
pagination:
total: 2
limit: 20
offset: 0
error: null
Installation
From crates.io
The crate name is quicknode-cli but the installed binary is qn.
Homebrew (macOS, Linux)
From source
&&
Authentication
You will need a Quicknode API key to get started. Once you have that, you can run qn auth login
qn resolves your API key from the first source that matches:
--api-key <KEY>flagQN_CLI__API_KEYenvironment variable~/.config/qn/config.toml— or$XDG_CONFIG_HOME/qn/config.tomlif that env var is set. Managed byqn auth login.
If none match, qn exits with code 4 and tells you to run qn auth login.
Regular commands never prompt — only qn auth login does. This keeps scripts
and CI deterministic.
Output
Pick a format with --format <FMT> (alias -o <FMT>):
--format |
Best for |
|---|---|
table |
Humans on a TTY. Pretty UTF-8 tables with optional color. Default when stdout is a terminal. |
json |
Scripts and pipelines (jq, gron, …). |
yaml |
Same shape as JSON, easier to skim by eye. |
md |
GitHub-flavored markdown — paste into PRs, issues, docs. |
toon |
Token-Oriented Object Notation — compact serialization optimized for LLM prompts. Default when stdout is not a terminal (piped / agent invocations). |
Other output flags:
-w/--wide: add extra columns totableandmdoutput (e.g. HTTP/WSS URLs inendpoint list). Mirrorskubectl get -o wide. Doesn't affectjson/yaml/toon, which always include everything.--no-color: plain ASCII (also honored:NO_COLORenv var,TERM=dumb, non-TTY stdout, any non-tableformat).--quiet: suppress state-change notes on stderr.--verbose: include API error bodies and other detail.
You can also set defaults in ~/.config/qn/config.toml:
[]
= "yaml" # default --format value
= true # always show extra columns in table/md output
CLI flags win over config values. Built-in defaults: format = "table" when stdout is a TTY, "toon" otherwise; wide = false.
qn follows the Command Line Interface Guidelines: data on stdout, diagnostics on stderr, meaningful exit codes (0 success, 2 API error, 3 network error, 4 auth/config, 5 needs confirmation), and a documented -h/--help at every subcommand level.
Example usage
Endpoints
|
Streams
Webhooks
KV store
|
Other
Shell completions
Configuration via environment
| Variable | Description |
|---|---|
QN_CLI__API_KEY |
Your Quicknode API key |
qn deliberately uses its own QN_CLI__ namespace so the CLI's env vars don't
collide with — or silently leak into — direct use of the underlying SDK. The
CLI hands the key to the SDK explicitly; it does not read the SDK's
QN_SDK__* environment namespace.
The hidden --base-url <URL> flag overrides the API host for all four
sub-clients at once (used for integration tests and on-prem mirrors).
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | CLI error (bad argument, IO, decode) |
| 2 | API error (server returned 4xx/5xx) |
| 3 | Network failure (timeout, connect, transport) |
| 4 | Missing or invalid API key / config |
| 5 | Operation needs confirmation (pass --yes or --yes --yes) |
| 130 | Interrupted (SIGINT) |
License
MIT