indodax-cli
Unofficial Rust CLI for Indodax. Use it to inspect markets, manage account data, place spot orders, stream live WebSocket events, run paper trading and price alerts, and expose the same command surface to agents through MCP.
Highlights
- Public market data: server time, pairs, ticker, all tickers, summaries, order book, trades, OHLC, and price increments.
- Private account data: account info, balances, transactions, and trade history.
- Spot trading: buy, sell, cancel, cancel by client order ID, cancel all, and deadman countdown.
- Funding: withdrawal fee lookup, crypto withdrawal, and withdrawal callback validation server.
- Real-time streams: ticker, trades, order book, summary, and private order updates.
- Paper trading: risk-free simulated trading with balances, orders, fills, history, and status.
- Price alerts: threshold and percentage alerts with one-shot checks or live WebSocket monitoring.
- Automation-friendly output: human tables by default, JSON envelopes with
-o json. - Credential resolution: CLI flags, environment variables, or
~/.config/indodax/config.toml. - Agent support: MCP server mode with guarded dangerous operations.
Recent Highlights
- WebSocket reliability overhaul: application-level pings, automatic reconnection with exponential backoff, and private WebSocket support for real-time order and balance updates.
- Secure WebSocket authentication: configurable WebSocket tokens with fallback to a stable default.
- TradeAPI-2 compliance: normalized symbol formats and stricter request handling across commands.
- Response parsing improvements: order book handling supports both legacy and modern API shapes.
Installation
Install from source:
Install from crates.io:
Install from npm:
On Android/Termux, npm install -g indodax-cli downloads the Android release binary when available. If the release asset is missing, it falls back to a local cargo build, so cargo still needs to be installed in Termux for that fallback path.
Run with Docker:
Run from the checkout:
Quick Start
Market data does not require credentials:
Configure private API credentials:
Or use environment variables:
Credential priority:
--api-keyand--api-secretINDODAX_API_KEYandINDODAX_API_SECRET~/.config/indodax/config.toml
Command Reference
Global options:
indodax [OPTIONS] <COMMAND>
Options:
-o, --output <table|json> Output format [default: table]
--api-key <API_KEY> API key override
--api-secret <API_SECRET> API secret override
--api-secret-stdin Read API secret from stdin
-v, --verbose Enable verbose logs
--yes, --force Skip confirmation prompts
Market
Account
Trading
Funding
For withdrawals, Indodax may require a callback URL. Configure it with:
WebSocket Streaming
Public streams:
Private stream:
Price Alerts
Alerts are stored in ~/.config/indodax/alerts.json.
Paper Trading
Paper trading mirrors the live order interface for safer strategy testing.
Interactive Shell
MCP Server
Service groups:
| Group | Tools | Auth Required | Dangerous |
|---|---|---|---|
market |
Server time, ticker, pairs, orderbook, trades, OHLC, price increments | No | No |
account |
Balance, trade history, transactions, 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 |
By default, trade and funding MCP tools require acknowledged: true. Use --allow-dangerous only for controlled local automation.
Example MCP client configuration:
Output Formats
Table mode is the default:
JSON mode is intended for scripting and automation:
Error responses in JSON mode use structured envelopes:
E2E Testing
The repository includes live API smoke tests:
Environment knobs:
INDODAX_BIN=./target/debug/indodax
Latest local verification:
cargo test: 296 passed
./scripts/e2e_minimal.sh --public: passed
./scripts/e2e_minimal.sh --private: skipped private checks (credentials unavailable)
./scripts/e2e_minimal.sh --ws: passed
API Coverage
- Public REST: Indodax market endpoints
- Private REST: Indodax TradeAPI and TradeAPI-2 endpoints
- Public WebSocket:
wss://ws3.indodax.com/ws/ - Private WebSocket:
wss://pws.indodax.com/ws/
Architecture
This project is inspired by the Kraken CLI architecture and built with modern Rust:
clapfor derive-based CLI parsingtokiofor async runtimetokio-tungstenitefor WebSocket streamsreqwestfor REST API callsserdefor serialization and deserializationcomfy-tablefor terminal tablesrmcpfor Model Context Protocol support
Testing Standards
Every release should pass:
- Unit tests with
cargo test - Public E2E smoke tests
- WebSocket smoke tests
- Private read-only tests when credentials are available
Coverage is maintained across auth, client, config, errors, commands, mcp, and output modules.
Security
- Credentials are stored with
0600permissions when usingindodax auth set. - HMAC-SHA512 signing is used for private API authentication.
- Prefer read-only API keys for account inspection and WebSocket monitoring.
- Use least-privilege exchange API keys for MCP and automation.
- Never commit real API keys, secrets, callback tokens, or listen keys.
Development
Contributing
Contributions are welcome:
- Fork the repository.
- Create a feature branch.
- Run tests and relevant E2E smoke checks.
- Open a pull request.
Related Projects
If you use multiple exchanges, check out these related CLI tools built with the same architecture:
- indodax-cli - CLI for Indodax
- bittime-cli - CLI for Bittime
- binance-cli - CLI for Binance Spot
- tokocrypto-cli - CLI for Tokocrypto
- kraken-cli - CLI for Kraken (Spot, Margin, Futures)
License
MIT
Disclaimer
This project is unofficial and is not affiliated with or endorsed by Indodax. Cryptocurrency trading is risky; review commands carefully before using write-capable API keys.