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

# Global install (recommended for interactive use)
npm install -g @chainstream-io/cli

# Zero-install, always-latest (recommended for agents and CI)
npx @chainstream-io/cli <command>
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

FlagPurpose
--versionPrint the CLI version and exit
--jsonEmit single-line machine-readable JSON (default output is pretty-printed JSON)
--helpPrint help for the current command or group

Environment variables

VariablePurposeDefault
CHAINSTREAM_API_KEYAPI key used in lieu of config.jsonunset
CHAINSTREAM_API_URLOverride REST base URLhttps://api.chainstream.io
CHAINSTREAM_AUTH_URLOverride Auth service URLproduction default
CHAINSTREAM_GRAPHQL_URLOverride GraphQL endpointhttps://graphql.chainstream.io/graphql
SOLANA_RPC_URLOverride Solana RPC for wallet / balance readspublic RPC
BASE_RPC_URLOverride Base RPCpublic RPC
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).
CommandPurposeArguments / Options
loginCreate a TEE-backed wallet (default) or start an email OTP flow. Auto-grants the nano trial (50K CU, 30 days) on first login[email]; --key; --email
verifyComplete an email OTP login started by login --email--otp-id; --code; --email
logoutClear the session (keeps keys on disk)
bind-emailBind an email to an existing wallet[email]
bind-email-verifyFinish the email-bind OTP flow (non-interactive)--otp-id; --code; --email

token — Token information and analytics

SubcommandPurposeOptions
searchSearch tokens by keyword--keyword (required); --chain (required); --limit
infoGet full token detail--chain; --address
securitySecurity report (honeypot, mint authority, freeze authority, etc.)--chain; --address
holdersTop token holders--chain; --address; --limit
candlesOHLCV candlesticks--chain; --address; --resolution; --from; --to; --limit
poolsLiquidity pools for a token--chain; --address

market — Market data and discovery

SubcommandPurposeOptions
trendingHot / trending tokens by window--chain; --duration; --limit
newNewly created tokens--chain; --limit
tradesRecent trades, optionally filtered to a token--chain; --token; --limit

wallet — Wallet analytics, management, and signing

SubcommandPurposeOptions
signSign a serialized transaction with the on-host wallet--chain; --tx
profilePnL + net worth + top holdings in one call--chain; --address
pnlPnL detail--chain; --address
holdingsToken balances--chain; --address; --limit
activityTransfer history--chain; --address; --limit
addressShow current wallet addresses
balanceNative + USDC balance (single request)--chain (sol | base)
set-rawImport a raw private key (dev / testing only)--chain (base | sol)
linkLink a wallet address to your subscription--chain (evm | solana)
pricingList available x402 plans and prices

dex — DEX route, swap, and token creation

All commands return unsigned transactions built server-side; signing happens on the host wallet.
SubcommandPurposeOptions
routeAggregated route + unsigned swap transaction--chain; --from; --input-token; --output-token; --amount; --slippage; --dex; --recipient; --anti-mev; --gas-price; --gas-limit; --max-fee-per-gas; --max-priority-fee-per-gas
swapUnsigned swap transaction (direct, no aggregation)--chain; --from; --input-token; --output-token; --amount; --slippage; --dex
createUnsigned launchpad token creation transaction--chain; --from; --name; --symbol; --dex; --uri; --image

tx — Broadcast and gas

SubcommandPurposeOptions
sendBroadcast a signed transaction--chain; --signed-tx; --submit-type; --anti-mev
gas-priceCurrent gas price (EVM only)--chain (eth | bsc)
estimate-gasEstimate gas limit for an EVM call--chain; --from; --to; --data; --value

job — Async job polling

SubcommandPurposeOptions
statusCheck the status of a long-running job--id; --wait; --timeout

graphql — GraphQL schema and queries

See the full usage guide in Access Methods → CLI → GraphQL subcommand and the Agent Skill at chainstream-graphql.
SubcommandPurposeOptions
schemaDiscover schema (cubes, types, fields)--summary; --type <cube>; --full; --refresh
queryExecute a GraphQL query--query <gql>; --file <path>; --var <json>

plan — Subscription and x402 auto-pay

SubcommandPurposeOptions
statusCurrent plan, remaining quota and usage--chain; --address
purchasePurchase a plan via x402 / MPP (auto-saves the returned API key to config.json)--plan

config — Local configuration

SubcommandPurposeOptions
setSet a configuration value--key (apiKey | baseUrl | walletChain); --value
getShow current configuration--key (optional)
authShow current authentication status

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.