Indodax CLI — Unofficial Terminal Interface for Indodax
Description: A fast, feature-rich command-line interface for the Indodax cryptocurrency exchange. Trade, track markets, manage your account, and integrate with AI agents via MCP.

## ⚡ Features

Everything you need to interact with Indodax — without leaving your terminal.

🤖

### AI Agent Integration

Built-in MCP server for Claude, ChatGPT, Cursor, VS Code, Gemini CLI, and any MCP-compatible agent.

🔥

### Real-Time Streams

WebSocket support for live ticker, trades, order book, and private order updates.

📊

### Market Data

OHLCV, order books, tickers, summaries, and price increments at your fingertips.

💰

### Account & Trading

Check balances, place orders, view history, and manage your portfolio.

🧪

### Paper Trading

Simulated trading environment with virtual balances to test strategies risk-free.

🔔

### Price Alerts

Set price alerts and monitor in real-time via WebSocket. Never miss a trading opportunity!

🔐

### Secure Auth

HMAC-SHA512 signing with 0600-permission config files and env variable support.

## 📦 Installation

Requires Rust. Install from source in seconds:

    git clone https://github.com/ibidathoillah/indodax-cli.git
    cd indodax-cli
    cargo install --path .

Or build locally:

    cargo build --release
    ./target/release/indodax --help

## 🚀 Quick Start

### 1. Check Market Data (No API Key Needed)

    indodax market server-time
    indodax market ticker btc_idr
    indodax market orderbook btcidr
    indodax market pairs

### 2. Set API Credentials (For Account & Trading)

    indodax auth set --api-key YOUR_API_KEY --api-secret YOUR_API_SECRET

Or use environment variables for CI/CD:

    export INDODAX_API_KEY=your_api_key
    export INDODAX_API_SECRET=your_api_secret

### 3. Check Your Account

    indodax account balance
    indodax account info

### 4. Start the Interactive Shell

    indodax shell

## 🤖 MCP Server

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://` and `wss://` endpoints. Treat this integration as alpha and use least-privilege API keys.

### Usage

    indodax mcp                           # default: market, account, paper (read-only)
    indodax mcp -s all                    # all services, dangerous calls require acknowledged=true
    indodax mcp -s all --allow-dangerous  # all services, no per-call confirmation
    indodax mcp -s market,trade,paper     # specific service groups

### Service Groups

Group | Tools | Auth | 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

### Configure Your MCP Client

Add to your MCP client configuration:

Claude Desktop (`claude_desktop_config.json`):

    {
      "mcpServers": {
        "indodax": {
          "command": "indodax",
          "args": ["mcp", "-s", "all"]
        }
      }
    }

VS Code / Cursor (`.vscode/mcp.json` or Cursor MCP settings):

    {
      "mcpServers": {
        "indodax": {
          "command": "indodax",
          "args": ["mcp", "-s", "all"]
        }
      }
    }

Gemini CLI:

    gemini extensions install https://github.com/ibidathoillah/indodax-cli

## 📖 Commands

### Market Data (Public API)

Command | Description
--- | ---
`market server-time` | Get server time
`market pairs` | List available trading pairs
`market ticker <pair>` | Get ticker for a pair
`market ticker-all` | Get tickers for all pairs
`market summaries` | Get 24h and 7d summaries
`market orderbook <pair>` | Get order book
`market trades <pair>` | Get recent trades
`market ohlc` | Get OHLCV candle data

### Account (Private API)

Command | Description
--- | ---
`account info` | Get account information
`account balance` | Show wallet balances
`account open-orders` | List open orders
`account order-history` | Get order history (v2 API)
`account trade-history` | Get trade fill history (v2 API)

### Trading (Private API)

Command | Description
--- | ---
`trade buy` | Place a buy order
`trade sell` | Place a sell order
`trade cancel` | Cancel an order by ID
`trade countdown` | Deadman switch countdown

### WebSocket Streaming

Command | Description
--- | ---
`ws ticker <pair>` | Stream real-time ticker
`ws trades <pair>` | Stream real-time trades
`ws book <pair>` | Stream real-time order book
`ws orders` | Stream private order updates

## 📝 Output Formats

Human-friendly tables by default, or JSON for automation and AI agent consumption.

    # Table mode (default)
    indodax market ticker btc_idr

    # JSON mode
    indodax -o json market ticker btc_idr

When an error occurs in JSON mode, a structured error envelope is returned:

    {
      "error": true,
      "message": "Invalid trading pair: xxx_idr",
      "error_type": "invalid_pair",
      "retryable": false
    }

## 🧪 Paper Trading

Test strategies with virtual balances before risking real funds.

    # Initialize with default balances (100M IDR, 1 BTC)
    indodax paper init

    # Place simulated orders
    indodax paper buy --pair btc_idr --price 500000000 --amount 0.1
    indodax paper sell --pair btc_idr --price 600000000 --amount 0.05

    # Check status
    indodax paper balance
    indodax paper status

## 🔔 Price Alerts

Set price alerts and get notified when conditions are met. Monitor in real-time via WebSocket.

    # Price threshold alerts
    indodax alert add -p btc_idr --above 150000000
    indodax alert add -p btc_idr --below 50000000

    # Percentage change alerts
    indodax alert add -p btc_idr --percent-up 5
    indodax alert add -p btc_idr --percent-down 10

    # Real-time monitoring
    indodax alert watch
    indodax alert list

## 🔐 Security

Indodax uses HMAC-SHA512 signing. Credentials are resolved in priority order:

1. CLI flags (`--api-key`, `--api-secret`)
2. Environment variables (`INDODAX_API_KEY`, `INDODAX_API_SECRET`)
3. Config file (`~/.config/indodax/config.toml` with `0600` permissions)