跳转至主要内容

Quicknode 命令行界面

更新于
Jul 13, 2026

概述

Quicknode 命令行界面 is the qn command-line tool for working with Quicknode product APIs from a terminal, shell script, or CI job.

安装

安装 qn with the recommended command for your system. The install tabs are selected from your browser user agent when possible, and you can choose any install path manually.

Recommended for macOS. Homebrew also works on Linux.

brew 安装 quicknode/tap/qn

After installation, check the version:

qn --version

Then authenticate and verify access:

qn auth login
qn auth whoami

Run your first read commands:

qn chain list
qn endpoint list
qn endpoint list --format json

Product coverage

Use the CLI to inspect and manage:


  • Admin API: Endpoints, teams, usage, billing, logs, metrics, endpoint security, rate limits, and account tags.
  • RPC: Make on-chain JSON-RPC calls to any supported network without provisioning an endpoint.
  • Streams: Stream listing, creation, inspection, lifecycle actions, and filter testing.
  • Webhooks: Webhook listing, template creation, inspection, lifecycle actions, and enabled counts.
  • Key-Value Store: Sets and lists for state, watchlists, cursors, filters, and small lookup tables.
  • SQL 浏览器:对已建立索引的区块链数据运行 SQL 查询,并检索表结构。

When to use the CLI

Use the CLI when the terminal is the fastest interface for the job.

常见的工作流程包括:


  • List endpoints, URLs, logs, and metrics while debugging.
  • Make on-chain JSON-RPC calls to any supported network with qn rpc call.
  • Check account usage, billing records, chains, teams, and tags.
  • Create or inspect Streams and Webhooks during development.
  • Read and update Key-Value Store data from scripts.
  • 使用 SQL Explorer 对已建立索引的区块链数据执行 SQL 查询。
  • Run repeatable CI checks with explicit credentials and structured output.

For application code, use the Quicknode SDK or the product REST APIs directly.

验证

Create an API key in the Quicknode dashboard, then run:

qn auth login
qn auth whoami

qn resolves credentials in this order:


  1. --api-key <KEY>
  2. --config-file <PATH>
  3. ~/.config/qn/config.toml

The CLI does not read API keys from environment variables. For scripts and CI, pass --api-key from a secret store or write a config file outside your repository and pass --config-file.

For one command, pass the key explicitly:

qn --api-key YOUR_API_KEY endpoint list --format json

For CI, write a config file outside the repository and point the CLI at it:

mkdir -p "$RUNNER_TEMP/qn"
printf '[api]\nkey = "%s"\n' "$QUICKNODE_API_KEY" > "$RUNNER_TEMP/qn/config.toml"

qn --config-file "$RUNNER_TEMP/qn/config.toml" endpoint list --format json

Output

Set the output format with --format-o.

Format使用
表格Human-readable terminal tables. This is the default when stdout is a terminal.
jsonScripts, jq, tests, and API-shaped output.
yamlReadable structured output.
mdMarkdown tables for issues, pull requests, and docs.
toonCompact structured output. This is the default when stdout is not a terminal.

Examples:

qn endpoint list --format json
qn usage summary --from 7d -o yaml
qn endpoint list --wide

Agent context

使用 qn agent context to print a self-contained usage guide for AI agents and automated tools. It makes no network request and does not require authentication.

qn agent context
qn agent context -o json

The command is designed for agent context windows, including Claude and other tools that can ingest Markdown or JSON.

Shell completions

Generate completions for your shell:

qn completions zsh > ~/.zfunc/_qn
qn completions bash > /etc/bash_completion.d/qn
qn completions fish > ~/.config/fish/completions/qn.fish
qn completions powershell > qn.ps1
qn completions elvish > qn-completions.elv

Common commands

qn rpc call eth_blockNumber
qn stream list --limit 20
qn webhook enabled-count
qn kv set ls
qn sql query "SELECT * FROM hyperliquid_trades LIMIT 10" --cluster hyperliquid-core-mainnet
qn sql schema --cluster hyperliquid-core-mainnet
qn usage summary --from 7d
qn billing invoices

Confirmations

Commands that can delete, archive, pause, revoke, or otherwise change resources prompt before acting.

qn endpoint archive 123
qn stream delete 123
qn webhook pause 123

In non-interactive environments, confirmation-gated commands exit before sending a request unless you explicitly opt out of prompts. Keep documentation examples prompt-safe by default.

下一步


分享此文档