Skip to main content
The chainstream CLI exposes every data product, GraphQL cube and DeFi primitive over a single binary. This page is the authoritative command reference — for narrative usage and installation see Access Methods → CLI.

Install

Either invocation works everywhere below. The short form chainstream <cmd> is used throughout this reference and is equivalent to npx @chainstream-io/cli <cmd>.

Global flags

Environment variables

Config is persisted to ~/.config/chainstream/config.json; P-256 wallet keys live in ~/.config/chainstream/keys/. chainstream logout clears the wallet config but preserves the keys.

Authentication commands (top-level)

These commands are registered at the program root (no sub-group).

token — Token information and analytics

market — Market data and discovery

wallet — Wallet analytics, management, and signing

dex — DEX route, swap, and token creation

All commands return unsigned transactions built server-side; signing happens on the host wallet.

tx — Broadcast and gas

job — Async job polling

graphql — GraphQL schema and queries

See the full usage guide in Access Methods → CLI → GraphQL subcommand and the Agent Skill at chainstream-graphql.

plan — Subscription and x402 auto-pay

config — Local configuration

Exit behaviour

  • 0 — success (or empty result)
  • 1 — user-facing error with JSON payload on stdout (unless --json is off, in which case a formatted error is printed)
  • Non-zero exit on auth failure (401), payment-required (402), or network error
On 402 from any data/GraphQL command, the CLI prints a pointer to wallet pricing and plan purchase. plan purchase itself handles x402 auto-pay transparently.

Next

Access Methods → CLI

Narrative usage: install, auth, first commands, GraphQL subcommand.

Agent Skills

How AI agents should drive the CLI.

x402 Payments

How plan purchase and on-the-fly 402 handling work.

GraphQL

Endpoint, schema and authentication for the GraphQL surface.