Skip to main content
kraken-cli is a compiled CLI for trading and account management across the Kraken exchange. No runtime dependencies. One install covers Spot, Derivatives, xStocks, Forex, Earn, and Subaccounts, and puts three binaries on your PATH:
  • kraken — the CLI
  • kraken-mcp — the MCP server for AI agents
  • kraken-shell — an interactive shell

GitHub

Source, releases, and changelog

MCP server

Give AI agents 152 MCP tools from the CLI

Install

Supported on macOS (Apple Silicon and Intel) and Linux (x86_64 and ARM64). On Windows, use WSL. Every release artifact is signed with minisign; see Verifying binaries. The installer puts the binaries in ~/.cargo/bin (or $CARGO_HOME/bin if you set it) and adds that folder to your PATH for new terminals only. Open a new terminal window, or run source "$HOME/.cargo/env". If an AI agent or editor was already running, quit it and start it again from a new terminal. Verify the install:

What it covers

188 commands across 15 groups. Six asset classes in one install: Spot is the default: kraken order buy, kraken balance. Futures commands are explicit: kraken futures order buy.

Command groups

The command catalog lists every command with its arguments. It is generated from the code, so it always matches the release.

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.
To trade live, replace kraken paper buy with kraken order buy and provide credentials. Pass --type when you switch: paper buy defaults to a market order and order buy to a limit order. When a paper workspace has the evidence, kraken workspace promote checks the promotion checklist and switches the workspace to live execution on the real account. It is a dangerous command: it needs credentials and asks for confirmation.

Sessions and recipes

Record a session in a paper workspace, explain its P&L, then package it so it can run again:

Scripting and automation

Every command supports -o json. Exit code 0 means success, 1 a runtime failure (with a JSON error envelope on stdout), and 2 a usage error. This makes the CLI composable in shell scripts and CI pipelines:
Stdout always produces valid JSON on success or an error envelope on failure. Stderr carries diagnostics only. Never parse stderr for data.

Account management

Dead man’s switch

Cancel all open orders if your process stops sending heartbeats:

Authentication

Sign in once in the browser:
It saves a restricted Spot API key with no withdrawal rights and an expiry date: 90 days, or less with --valid-for. --read-only creates a key that cannot trade. It needs a terminal, so run it yourself; a script or an AI agent cannot create a key. To use a key you created yourself, generate it at Settings → API for Spot, or in the Futures interface for Derivatives, and store it with the setup wizard. Run it in a normal terminal, because it reads your input:
Credentials are resolved in this order:
  1. Command-line flags (--api-key, --api-secret)
  2. Environment variables (KRAKEN_API_KEY, KRAKEN_API_SECRET, and KRAKEN_FUTURES_API_KEY, KRAKEN_FUTURES_API_SECRET for futures)
  3. The active stored key in config.toml (~/.config/kraken/ on Linux, ~/Library/Application Support/kraken/ on macOS): the API key from kraken setup or kraken auth set, or the sign-in key from kraken auth login
kraken auth show tells you which stored key is active, and kraken auth switch api-key or kraken auth switch sign-in changes it. Grant only the permissions your workflow needs. Never paste API keys into an AI chat.

Interactive shell

For exploratory sessions:

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 give LLM agents the CLI’s request/response commands as tools. Agent resources shipped with the CLI: