Indodax CLI
The unofficial, fast, and feature-rich command-line interface for Indodax โ Indonesia's largest cryptocurrency exchange.
Track markets, execute trades, manage your portfolio, and stream real-time data โ all from your terminal.
โจ Features
- ๐ค AI Agent Integration โ Built-in MCP (Model Context Protocol) server for Claude, ChatGPT, Cursor, VS Code, Gemini CLI, and any MCP-compatible agent
- ๐ฅ Real-Time WebSocket Streams โ Live ticker, trades, order book, and private order updates
- ๐ Comprehensive Market Data โ OHLCV, order books, tickers, summaries, and price increments
- ๐ฐ Full Account Management โ Balances, open orders, order history, trade history, and transactions
- ๐ ๏ธ Powerful Trading โ Place buy/sell orders, cancel orders, and set deadman switches
- ๐งช Paper Trading โ Risk-free simulated trading environment to test strategies
- ๐ Price Alerts โ Set price alerts and monitor in real-time via WebSocket
- ๐ Secure Authentication โ HMAC-SHA512 API signing with multiple credential resolution methods
- ๐ Flexible Output โ Human-friendly tables or machine-readable JSON
- ๐ฅ๏ธ Interactive Shell โ Built-in REPL for exploratory usage
- โก Blazing Fast โ Built with Rust for maximum performance and safety
๐ฆ Installation
From Cargo (Crates.io)
From NPM
From Docker
From Source (requires Rust)
๐ Recent Highlights (v0.1.13)
- ๐ฅ WebSocket Reliability Overhaul: Implemented application-level Pings, automatic reconnection with exponential backoff, and a complete rewrite of the Private WebSocket to support real-time order and balance updates.
- ๐ Secure Authentication: Added support for user-configurable WebSocket tokens with fallback to a reliable hardcoded default, ensuring stable connections even if official tokens change.
- ๐ Strict TradeAPI-2 Compliance: Continued enforcement of official Indodax specifications and normalized symbol formats across all commands.
- ๐งน Internal Refactoring: Improved error handling and response parsing for the Orderbook, supporting both legacy and modern API formats.
๐ Quick Start
1. Check Market Data (No API Key Needed)
Market data commands work without any API credentials:
2. Configure API Credentials (For Account & Trading)
Or use environment variables:
Credentials are resolved in this priority order:
- CLI flags (
--api-key,--api-secret) - Environment variables (
INDODAX_API_KEY,INDODAX_API_SECRET) - Config file (
~/.config/indodax/config.tomlwith0600permissions)
3. View Account (Requires API Key)
4. Start the Interactive Shell
๐ค MCP Server (AI Agent Integration)
indodax-cli includes a built-in Model Context Protocol (MCP) server over stdio. No subprocess wrappers needed.
MCP tool calls run through the same Rust code path as CLI commands and inherit the same error handling, rate-limit behavior, and security model.
โ ๏ธ Warning
MCP is local-first and designed for your own machine. Any AI agent connected to this MCP server uses the same configured Indodax account and API key permissions. Do not expose, tunnel, or share this server outside systems you control. Always use
https://andwss://endpoints. Treat this integration as alpha and use least-privilege API keys.
Usage
Service Groups
| Group | Tools | Auth Required | Dangerous |
|---|---|---|---|
market |
Server time, ticker, pairs, orderbook, trades, OHLC, price increments | No | No |
account |
Balance, open orders, order history, trade history, account info | Yes | No |
trade |
Buy, sell, cancel orders | Yes | Yes |
funding |
Withdraw fees, withdraw crypto | Yes | Yes |
paper |
Paper trading init, balance, buy, sell, orders, cancel, history, status | No | No |
auth |
Show config, test credentials | Varies | No |
Dangerous Operations
By default, trade and funding groups require each tool call to include acknowledged: true as a parameter. Use --allow-dangerous to skip this per-call confirmation.
Configure Your MCP Client
Add to your MCP client configuration (Claude Desktop, VS Code, Cursor, Windsurf, etc.):
Claude Desktop (claude_desktop_config.json):
VS Code / Cursor (.vscode/mcp.json or Cursor MCP settings):
Gemini CLI:
๐ Usage
indodax [OPTIONS] <COMMAND>
Options:
-o, --output <OUTPUT> Output format: table or json [default: table]
--api-key <API_KEY> API key (overrides config and env var)
--api-secret <API_SECRET> API secret (overrides config and env var)
-v, --verbose Enable verbose output
-h, --help Print help
-V, --version Print version
๐ Commands
Market Data (Public API)
| Command | Description |
|---|---|
indodax market server-time |
Get server time |
indodax market pairs |
List available trading pairs |
indodax market ticker <pair> |
Get ticker for a trading pair |
indodax market ticker-all |
Get tickers for all pairs |
indodax market summaries |
Get 24h and 7d market summaries |
indodax market orderbook <pair> |
Get order book depth |
indodax market trades <pair> |
Get recent trades |
indodax market ohlc |
Get OHLCV candle data |
indodax market price-increments |
Get tick sizes |
Account (Private API)
| Command | Description |
|---|---|
indodax account info |
Get account information |
indodax account balance |
Show wallet balances |
indodax account open-orders |
List open orders |
indodax account order-history |
Get order history (v2 API) |
indodax account trade-history |
Get trade fill history (v2 API) |
indodax account trans-history |
Get deposit/withdrawal history |
indodax account get-order |
Get order details |
Trading (Private API)
| Command | Description |
|---|---|
indodax trade buy -p <pair> -i <idr> |
Place a buy order (IDR amount) |
indodax trade buy -p <pair> -a <amount> [-r <price>] |
Place a buy order (base amount) |
indodax trade sell -p <pair> -a <amount> [-r <price>] |
Place a sell order |
indodax trade cancel -i <id> -p <pair> -t <type> |
Cancel an order by ID |
indodax trade cancel-by-client-id |
Cancel by client order ID |
indodax trade countdown |
Deadman switch countdown |
Funding (Private API)
| Command | Description |
|---|---|
indodax funding withdraw-fee |
Check withdrawal fee |
indodax funding withdraw |
Withdraw cryptocurrency |
indodax funding serve-callback |
Start callback validation server |
WebSocket Streaming
| Command | Description |
|---|---|
indodax ws ticker <pair> |
Stream real-time ticker |
indodax ws trades <pair> |
Stream real-time trades |
indodax ws book <pair> |
Stream real-time order book |
indodax ws summary |
Stream 24h summary |
indodax ws orders |
Stream private order updates |
Price Alerts
Set price alerts and monitor them in real-time via WebSocket. Never miss a trading opportunity!
| Command | Description |
|---|---|
indodax alert add -p <pair> --above <price> |
Alert when price goes above |
indodax alert add -p <pair> --below <price> |
Alert when price goes below |
indodax alert add -p <pair> --percent-up <%> |
Alert when price increases by % |
indodax alert add -p <pair> --percent-down <%> |
Alert when price decreases by % |
indodax alert list [--history] |
List all alerts |
indodax alert cancel -i <id> |
Cancel specific alert |
indodax alert cancel --all |
Cancel all alerts |
indodax alert check [-p <pair>] |
Check alerts against current prices |
indodax alert watch [-p <pair>] |
Monitor alerts in real-time (WebSocket) |
indodax alert triggered |
Show triggered alerts |
Paper Trading (Simulated)
Paper trading mirrors the live trade commands for easy switching between simulated and real trading.
| Command | Description |
|---|---|
indodax paper init [--idr N] [--btc N] |
Initialize with default or custom balances |
indodax paper reset |
Reset paper trading state |
indodax paper balance |
Show virtual balances |
indodax paper buy -p <pair> -i <idr> |
Simulated buy (IDR amount, like live) |
indodax paper buy -p <pair> -a <amt> [-r <price>] |
Simulated buy (base amount, like live) |
indodax paper sell -p <pair> -a <amt> [-r <price>] |
Simulated sell (matches live interface) |
indodax paper orders [-p <pair>] |
List open paper orders |
indodax paper cancel -i <id> |
Cancel a paper order |
indodax paper cancel-all |
Cancel all paper orders |
indodax paper fill -i <id> [-r <price>] |
Fill an open paper order |
indodax paper fill --all |
Fill all open orders at once |
indodax paper check-fills [-p <json>] [--fetch] |
Auto-fill based on market prices |
indodax paper topup -c <currency> -a <amount> |
Top up a virtual currency balance |
indodax paper history |
Show paper trade history |
indodax paper status |
Show paper trading status summary |
Authentication Management
| Command | Description |
|---|---|
indodax auth set |
Set API credentials |
indodax auth show |
Show current config |
indodax auth test |
Test API credentials |
indodax auth reset |
Remove stored credentials |
Utilities
| Command | Description |
|---|---|
indodax setup |
Interactive setup wizard |
indodax shell |
Start interactive REPL |
๐ Output Formats
Table mode (default) โ human-friendly aligned tables:
JSON mode โ for scripting and automation, with AI-friendly error envelopes:
When an error occurs in JSON mode, a structured error envelope is returned on stdout:
๐งช Paper Trading
Test your strategies without risking real funds. Paper trading mirrors the live trade commands for easy switching:
# Initialize with default balances (100M IDR, 1 BTC)
# Or with custom balances
# Buy orders (matches live trade interface)
# Sell orders (matches live trade interface)
# Check balances and status
# Manage orders
# Fill orders
# Auto-fill based on market prices
# Top up balances
# Reset to initial state
Tip: Paper trading uses the same command structure as live trading. Switch between modes by replacing
tradewithpaper.
๐ Price Alerts
Set price alerts and get notified when conditions are met. Alerts can be checked on-demand or monitored in real-time via WebSocket.
# Price threshold alerts
# Percentage change alerts (based on current price)
# Add note to alert
# List and manage alerts
# One-time check (HTTP polling)
# Real-time monitoring (WebSocket)
Tip: Use
indodax alert watchfor real-time price monitoring. Alerts are stored in~/.config/indodax/alerts.json.
๐ Authentication & Security
Indodax uses HMAC-SHA512 signing for API authentication. Your credentials are stored securely:
- Config file uses
0600permissions (owner read/write only) - Supports environment variables for CI/CD workflows
- CLI flags override everything for one-off commands
Withdrawal Callback URL
For withdrawals, Indodax requires a Callback URL to validate requests:
Then run the validation server:
๐๏ธ Architecture
This project is inspired by the Kraken CLI architecture and built with modern Rust:
clapโ powerful derive-based CLI parsingtokioโ async runtime for non-blocking I/Otokio-tungsteniteโ WebSocket client for real-time streamsreqwestโ HTTP client for REST API callsserdeโ robust serialization/deserializationcomfy-tableโ beautiful terminal tablesrmcpโ Model Context Protocol server for AI agent integration
๐งช Testing
This project maintains 100% test coverage across all core modules.
Run Tests
# Run all unit tests
# Run with output
# Check test coverage
Coverage Summary
| Module | Tests | Coverage |
|---|---|---|
auth.rs |
20+ | โ 100% |
client.rs |
30+ | โ 100% |
config.rs |
40+ | โ 100% |
errors.rs |
15+ | โ 100% |
lib.rs |
20+ | โ 100% |
commands/* |
90+ | โ 100% |
mcp/* |
20+ | โ 100% |
| Total | 299+ | โ 100% |
Testing Standards
Every release undergoes rigorous verification:
- Unit Tests: Mandatory
cargo testsuite (300+ tests) must pass on all platforms (CI/CD enforced). - E2E Tests: Manual verification using
scripts/e2e_minimal.shwith the smallest possible increments (e.g., 10,000 IDR) to ensure live API compatibility without significant risk.
E2E Testing
End-to-end tests are documented in E2E_TESTING_LOG.md, covering real API interactions including market data, account queries, and trade execution.
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License.
Disclaimer: This is an unofficial CLI and is not affiliated with or endorsed by Indodax. Use at your own risk. Cryptocurrency trading involves significant risk of loss.