Skip to main content

Documentation Index

Fetch the complete documentation index at: https://kraken-sandbox.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

kraken-cli is a single compiled binary for trading and account management across the Kraken exchange. No runtime dependencies. One install covers Spot, Derivatives, xStocks, Forex, Earn, and Subaccounts.

GitHub

Source, releases, and changelog

MCP server

Expose all 151 commands as tools for AI agents via the built-in MCP server

Install

curl --proto '=https' --tlsv1.2 -LsSf \
  https://github.com/krakenfx/kraken-cli/releases/latest/download/kraken-cli-installer.sh | sh
Supported on macOS (Apple Silicon and Intel), Linux (x86_64 and ARM64), and Windows via WSL. Release binaries are Minisign-verified. Verify the install:
kraken status && kraken ticker BTCUSD

What it covers

151 commands across 13 groups. Six asset classes in one binary:
Asset classExamplesNotes
Crypto spotBTC, ETH, SOL (1,400+ pairs)Default engine
xStocks (tokenized equities)AAPL, TSLA, SPY (79 assets)--asset-class tokenized_asset
ForexEUR/USD, GBP/USD (11 pairs)--asset-class forex
Perpetual futures317 contractsFutures engine
Inverse and fixed-date futuresBTC, ETH, SOLFutures engine
Earn / stakingFlexible and bonded strategieskraken earn

Command groups

GroupCommandsAuth required
market10No
account18Yes
trade9Yes
funding10Yes
earn6Yes
subaccount2Yes
futures39Mixed
paper10No
futures-paper17No
websocket15Mixed
futures-ws9Mixed
auth4No
utility2No

Paper trading

The CLI’s built-in paper trading engine runs against live prices with no authentication required. It is the recommended way to test strategies and integrations.
# Spot paper trading
kraken paper balance
kraken paper order buy BTCUSD 0.001 --type limit --price 50000
kraken paper positions

# Futures paper trading
kraken futures paper balance
kraken futures paper order buy PF_XBTUSD 1 --type limit --price 50000
Paper and live trading share the same command interface — switching to live is a matter of removing the paper subcommand and providing credentials.

Scripting and automation

All 151 commands support -o json output and consistent exit codes (0 = success, non-zero = failure), making them composable in shell scripts and CI pipelines:
# Cancel all open orders on BTC/USD
kraken spot orders cancel-all --pair BTC/USD

# Stream the live order book to a file
kraken spot ws book --symbol BTC/USD >> book.jsonl

# Fetch balance as JSON, filter with jq
kraken account balance -o json | jq '.XXBT'
Stdout always produces valid JSON on success or an error envelope on failure. Stderr carries diagnostics only. Never parse stderr for data.

Account management

kraken balance
kraken open-orders -o json
kraken account trades

Dead man’s switch

Cancel all open orders if your process stops sending heartbeats:
kraken spot cancel-after --timeout 60

Authentication

Credentials are resolved in this order:
  1. Command-line flags (--api-key, --api-secret)
  2. Environment variables (KRAKEN_API_KEY, KRAKEN_API_SECRET)
  3. Config file (~/.config/kraken/config.toml)
Run the setup wizard to configure interactively:
kraken setup
Generate API keys at Settings → API for Spot, or in the Futures interface for Derivatives. Grant only the permissions your workflow needs.

Interactive shell

For exploratory sessions:
kraken shell

AI agent integration

The CLI is designed for machine consumption: structured JSON output, stable error categories, and predictable exit codes. See the MCP server page to expose all commands as tools for LLM agents. Agent resources shipped with the CLI:
ResourcePurpose
AGENTS.mdFull agent integration guide
CONTEXT.mdRuntime context for tool-using agents
agents/tool-catalog.json151 commands with parameter schemas
agents/error-catalog.json9 error categories with retry guidance
skills/50 goal-oriented workflow packages
CLAUDE.mdClaude-specific guidance