Kraken Cli
The first AI-native CLI for trading crypto, stocks, forex, and derivatives.
Install / Use
npx skills add krakenfx/kraken-cliInstalls into whichever agent you are using.
README
Kraken CLI
The first AI-native CLI for trading crypto, stocks, forex, and derivatives.
Full Kraken API access. Built-in MCP server. Live and paper trading. Single binary.
Works with Cursor, Claude, Codex, Copilot, Gemini, Goose, and OpenClaw.
Try these with your AI agent:
"Install kraken-cli (https://github.com/krakenfx/kraken-cli) and build me a morning market brief."
"Watch ETH, SOL, and BTC for 30 seconds. What are the pros and cons of buying each right now?"
"Look up AAPLx, TSLAx, and SPYx on xStocks. Summarize how each is performing today."
"You are a Wall Street veteran with 20 years of experience. You have 1 minute. Paper trade BTC and show me your P&L."
"Open a 10x leveraged long on BTC futures paper with $5,000 collateral. Set a trailing stop at 3%."
[!CAUTION] Experimental software. Interacts with the live Kraken exchange and can execute real financial transactions. Read DISCLAIMER.md before using with real funds or AI agents.
Contents
- Installation
- What You Can Trade
- Quick Start
- MCP Server
- Workspaces, Sessions, and Research
- Paper Trading
- Commands
- API Keys & Configuration
- Verifying Binaries
- Contributing
- License & Disclaimer
Installation
Single binary, no runtime dependencies.
One-liner
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/krakenfx/kraken-cli/releases/latest/download/kraken-cli-installer.sh | sh
Detects your OS and architecture, downloads the right binary, and installs it. macOS (Apple Silicon and Intel) and Linux (x86_64 and ARM64) are supported. Windows: use WSL.
Verify it works:
kraken status && kraken ticker BTCUSD
Pre-built binaries are also available on the GitHub Releases page.
<details> <summary>Build from source</summary>Requires Rust.
cargo install --git https://github.com/krakenfx/kraken-cli
Or clone and build:
git clone https://github.com/krakenfx/kraken-cli.git
cd kraken-cli
cargo install --path .
</details>
What You Can Trade
One binary covers six asset classes. All trading commands work across asset classes using the same interface; pass --asset-class where needed.
| Asset class | Instruments | Margin | Flag | Example |
|---|---|---|---|---|
| Crypto spot | 1,400+ pairs (BTC, ETH, SOL, and hundreds more) | Up to 10x on major pairs | (default) | kraken order buy BTCUSD 0.001 --type limit --price 50000 |
| Tokenized U.S. stocks & ETFs (xStocks) | 79 assets: AAPL, NVDA, TSLA, GOOGL, AMZN, MSFT, SPY, QQQ, and more | Up to 3x on top 10 | --asset-class tokenized_asset | kraken order buy AAPLx/USD 0.1 --type limit --price 200 --asset-class tokenized_asset |
| Forex | 11 fiat pairs: EUR/USD, GBP/USD, USD/JPY, AUD/USD, and more | — | --asset-class forex | kraken ticker EURUSD --asset-class forex |
| Perpetual futures | 317 contracts: crypto, 5 forex perps, 11 equity/index perps (AAPL, NVDA, TSLA, SPY, QQQ, S&P 500) | Up to 50x | (futures engine) | kraken futures order buy PF_XBTUSD 1 --type limit --price 50000 |
| Inverse & fixed-date futures | 20 contracts: BTC, ETH, SOL, LTC, XRP, ADA, DOGE, LINK | Varies | (futures engine) | kraken futures order buy FI_XBTUSD_260327 1 --type limit --price 50000 |
| Earn / staking | Flexible and bonded strategies across multiple assets | — | — | kraken earn strategies --asset ETH |
xStocks are not available in the USA. Availability for all products varies by jurisdiction.
For AI Agents
If you're an AI agent or building one, start here:
| Resource | Description |
|----------|-------------|
| CONTEXT.md | Runtime context for tool-using agents |
| AGENTS.md | Full integration guide: auth, invocation, errors, rate limits |
| docs/feedback-ingest.md | How kraken feedback uploads to Kraken (limits, retention) |
| agents/tool-catalog.json | 174 commands with parameter schemas, types, and safety flags |
| agents/error-catalog.json | 10 error categories with retry guidance |
| skills/ | Goal-oriented SKILL.md workflow packages |
| CLAUDE.md | Claude-specific integration guidance |
Core invocation pattern:
kraken <command> [args...] -o json 2>/dev/null
- stdout is always valid JSON on success, or a JSON error envelope on failure.
- Exit code 0 means success. Non-zero means failure.
- stderr carries diagnostics only — structured JSON logs (warnings/errors by default, more with
-vorRUST_LOG). Never parse stderr for data.
Most CLIs are built for humans at a terminal. This one is built for LLM-based agents, MCP tool servers, and automated pipelines that need to call Kraken reliably without custom API clients.
- Structured output by default. Every command supports
-o json. No screen-scraping, no regex on table borders. - Consistent error envelopes. Errors are JSON objects with a stable
errorfield (auth,rate_limit,validation,api,network). Agents route onerrorwithout parsing human sentences. - Predictable exit codes. Success is 0, failure is non-zero. Combined with JSON errors on stdout, agents detect and classify failures programmatically.
- Paper trading for safe iteration. Test strategies against live prices with
kraken paper(spot) andkraken futures paper(perpetual futures) commands. No API keys, no real money, same interface as live trading. - Market memory.
kraken recordcaptures live streams into a local DuckDB/JSONL tape library with integrity counters; finalized tapes replay into paper sessions and feed the autoresearch lab. - Full API surface. The catalog describes 174 request/response commands covering Spot, Futures, xStocks, Forex, Funding, Earn, Subaccounts, and paper trading. Long-running WebSocket, recording, replay, session-start, and stream-daemon surfaces remain CLI-only.
- Built-in MCP server. Native Model Context Protocol support over stdio. No subprocess wrappers needed.
- Rate-limit aware. No client-side throttling. When the Kraken API rejects a request due to rate limits, the CLI returns an enriched error with
suggestion,retryable, anddocs_urlfields so agents can read the documentation and adapt their strategy.
Humans benefit from the same design: --output table renders clean tables, kraken shell provides a REPL, and kraken setup walks through configuration.
Verifying Binaries
Release binaries are signed with minisign. Every artifact on the Releases page has a corresponding .minisig signature file.
Public key:
RWQJue8SwPzZBZO8Up5ppAUqm0wM/gK5yjnam+Dbf7KbY0utkiO+7XCd
Verify a downloaded binary:
minisign -Vm kraken-cli-aarch64-apple-darwin.tar.gz -P RWQJue8SwPzZBZO8Up5ppAUqm0wM/gK5yjnam+Dbf7KbY0utkiO+7XCd
Install minisign: brew install minisign (macOS) or apt install minisign (Linux).
Quick Start
Public market data requires no credentials:
kraken ticker BTCUSD -o json
kraken orderbook BTCUSD --count 10 -o json
kraken trades BTCUSD --count 20 -o json
kraken ohlc BTCUSD --interval 60 -o json
With authentication:
export KRAKEN_API_KEY="your-key"
export KRAKEN_API_SECRET="your-secret"
kraken balance -o json
kraken open-orders -o json
kraken order buy BTCUSD 0.001 --type limit --price 50000 -o json
For humans (table output, interactive setup):
kraken setup
kraken ticker BTCUSD
kraken balance
kraken shell
API Keys & Configuration
Authenticated commands (trading, balances, order management) require a Kraken API key pair. Public market data and paper trading work without credentials.
Getting API keys
Spot (covers trading, balances, funding, earn, subaccounts): Settings > API on kraken.com. Full guide: How to create a spot API key.
Futures (only for kraken futures commands): Settings > Create Key on the Futures interface. Full guide: How to create a Futures API key.
Grant the minimum permissions your workflow needs. For read-only monitoring, "Query Funds" and "Query Open Orders & Trades" are sufficient.
Environment variables (recommended for agents)
export KRAKEN_API_KEY="your-key"
export KRAKEN_API_SECRET="your-secret"
export KRAKEN_FUTURES_API_KEY="your-futures-key" # optional
export KRAKEN_FUTURES_API_SECRET="your-futures-secret" # optional
Config file (for humans)
Store credentials in ~/.config/kraken/config.toml:
[auth]
api_key = "your-api-key"
api_secret = "your-api-secret"
[settings]
default_pair = "BTCUSD"
output = "table"
Or use the interactive wizard: kraken setup.
Credential resolution
Highest precedence first:
- Command-line flags (
--api-key,--api-secret) - Environment variables (
KRAKEN_API_KEY,KRAKEN_API_SECRET) - Config file (
~/.config/kraken/config.toml)
Security
- Config file is created with
0600permissions (owner read/write only) - Secrets are never
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
blender-python-addon
40.5kBlender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting
flutter-development-guidelines-cursorrules-prompt-file
40.5kCursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.
commit-push-pr
140.6kCommit, push, and open a PR
