indodax-cli 0.1.10

A command-line interface for the Indodax cryptocurrency exchange
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Indodax CLI โ€” Unofficial Terminal Interface for Indodax</title>
    <meta name="description" content="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.">
    <style>
        :root {
            --bg: #0d1117;
            --bg-elevated: #161b22;
            --border: #30363d;
            --text: #c9d1d9;
            --text-muted: #8b949e;
            --accent: #58a6ff;
            --accent-dim: #1f6feb;
            --success: #3fb950;
            --warning: #d29922;
            --danger: #f85149;
            --code-bg: #21262d;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
        }

        a {
            color: var(--accent);
            text-decoration: none;
        }

        a:hover {
            text-decoration: underline;
        }

        .container {
            max-width: 960px;
            margin: 0 auto;
            padding: 0 24px;
        }

        /* Header / Hero */
        header {
            border-bottom: 1px solid var(--border);
            background: var(--bg-elevated);
            padding: 64px 0 48px;
            text-align: center;
        }

        .badge {
            display: inline-block;
            background: var(--code-bg);
            border: 1px solid var(--border);
            border-radius: 20px;
            padding: 4px 14px;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 20px;
        }

        h1 {
            font-size: 48px;
            font-weight: 800;
            letter-spacing: -1px;
            margin-bottom: 12px;
            line-height: 1.2;
        }

        .subtitle {
            font-size: 20px;
            color: var(--text-muted);
            max-width: 640px;
            margin: 0 auto 32px;
        }

        .cta-row {
            display: flex;
            gap: 12px;
            justify-content: center;
            flex-wrap: wrap;
        }

        .btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 12px 24px;
            border-radius: 6px;
            font-weight: 600;
            font-size: 14px;
            transition: all 0.2s;
            border: 1px solid transparent;
        }

        .btn-primary {
            background: var(--accent-dim);
            color: #fff;
            border-color: var(--accent-dim);
        }

        .btn-primary:hover {
            background: var(--accent);
            text-decoration: none;
        }

        .btn-secondary {
            background: var(--bg);
            color: var(--text);
            border-color: var(--border);
        }

        .btn-secondary:hover {
            background: var(--code-bg);
            text-decoration: none;
        }

        /* Terminal window */
        .terminal {
            max-width: 720px;
            margin: 40px auto 0;
            background: #000;
            border-radius: 10px;
            border: 1px solid var(--border);
            overflow: hidden;
            text-align: left;
            box-shadow: 0 20px 50px rgba(0,0,0,0.5);
        }

        .terminal-header {
            background: var(--code-bg);
            padding: 10px 16px;
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .dot { width: 12px; height: 12px; border-radius: 50%; }
        .dot-red { background: var(--danger); }
        .dot-yellow { background: var(--warning); }
        .dot-green { background: var(--success); }

        .terminal-body {
            padding: 20px 24px;
            font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
            font-size: 14px;
            line-height: 1.7;
            color: #e6edf3;
        }

        .prompt { color: var(--success); }
        .cmd { color: #e6edf3; }
        .comment { color: var(--text-muted); }
        .output { color: #7d8590; }
        .highlight { color: var(--accent); }

        /* Sections */
        section {
            padding: 64px 0;
            border-bottom: 1px solid var(--border);
        }

        section:last-of-type {
            border-bottom: none;
        }

        h2 {
            font-size: 28px;
            font-weight: 700;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        h3 {
            font-size: 20px;
            font-weight: 600;
            margin: 32px 0 12px;
            color: var(--text);
        }

        p {
            color: var(--text-muted);
            margin-bottom: 16px;
        }

        /* Warning callout */
        .warning {
            background: rgba(210, 153, 34, 0.1);
            border: 1px solid var(--warning);
            border-radius: 8px;
            padding: 20px 24px;
            margin: 20px 0;
        }

        .warning strong {
            color: var(--warning);
        }

        .warning p {
            margin-bottom: 8px;
        }

        .warning p:last-child {
            margin-bottom: 0;
        }

        /* Features grid */
        .features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 24px;
            margin-top: 32px;
        }

        .feature {
            background: var(--bg-elevated);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 24px;
            transition: transform 0.2s, border-color 0.2s;
        }

        .feature:hover {
            transform: translateY(-3px);
            border-color: var(--accent-dim);
        }

        .feature-icon {
            font-size: 28px;
            margin-bottom: 12px;
        }

        .feature h3 {
            margin: 0 0 8px;
            font-size: 16px;
        }

        .feature p {
            margin: 0;
            font-size: 14px;
            line-height: 1.5;
        }

        /* Code blocks */
        pre {
            background: var(--code-bg);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 16px;
            overflow-x: auto;
            font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
            font-size: 13px;
            margin: 16px 0;
        }

        code {
            font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
            font-size: 13px;
            background: var(--code-bg);
            padding: 2px 6px;
            border-radius: 4px;
            border: 1px solid var(--border);
        }

        pre code {
            background: none;
            border: none;
            padding: 0;
        }

        /* Tables */
        table {
            width: 100%;
            border-collapse: collapse;
            margin: 16px 0;
            font-size: 14px;
        }

        th, td {
            text-align: left;
            padding: 10px 12px;
            border: 1px solid var(--border);
        }

        th {
            background: var(--bg-elevated);
            font-weight: 600;
            color: var(--text);
        }

        td {
            color: var(--text-muted);
        }

        tr:nth-child(even) {
            background: rgba(255,255,255,0.02);
        }

        /* Footer */
        footer {
            text-align: center;
            padding: 48px 0;
            color: var(--text-muted);
            font-size: 14px;
            border-top: 1px solid var(--border);
        }

        footer a {
            color: var(--text-muted);
            text-decoration: underline;
        }

        /* Responsive */
        @media (max-width: 600px) {
            h1 { font-size: 32px; }
            .subtitle { font-size: 16px; }
            .terminal { margin: 24px 12px 0; }
            section { padding: 40px 0; }
        }
    </style>
</head>
<body>

<header>
    <div class="container">
        <div class="badge">Unofficial CLI</div>
        <h1>Indodax CLI</h1>
        <p class="subtitle">Trade, track markets, and manage your Indodax account from the terminal. Built-in MCP server for AI agent integration.</p>
        <div class="cta-row">
            <a class="btn btn-primary" href="https://github.com/ibidathoillah/indodax-cli#readme">View on GitHub</a>
            <a class="btn btn-secondary" href="#installation">Installation</a>
            <a class="btn btn-secondary" href="#mcp">MCP Server</a>
            <a class="btn btn-secondary" href="paper.html">๐Ÿงช Paper Trading (Web)</a>
        </div>

        <div class="terminal">
            <div class="terminal-header">
                <span class="dot dot-red"></span>
                <span class="dot dot-yellow"></span>
                <span class="dot dot-green"></span>
            </div>
            <div class="terminal-body">
                <span class="prompt">$</span> <span class="cmd">indodax market ticker btc_idr</span><br>
                <span class="output">+----------+-------------+-------------+-----------+</span><br>
                <span class="output">| Pair     | Last Price  | High (24h)  | Low (24h) |</span><br>
                <span class="output">+----------+-------------+-------------+-----------+</span><br>
                <span class="output">| BTC/IDR  | 1,050,000,000 | 1,080,000,000 | 1,020,000,000 |</span><br>
                <span class="output">+----------+-------------+-------------+-----------+</span><br><br>
                <span class="prompt">$</span> <span class="cmd">indodax -o json account balance</span><br>
                <span class="highlight">{ "idr": 250000000, "btc": 0.42, "eth": 3.5 }</span><br><br>
                <span class="prompt">$</span> <span class="cmd">indodax mcp -s market,paper</span><br>
                <span class="comment"># MCP server started โ€” connect your AI agent</span>
            </div>
        </div>
    </div>
</header>

<section id="features">
    <div class="container">
        <h2>โšก Features</h2>
        <p>Everything you need to interact with Indodax โ€” without leaving your terminal.</p>
        <div class="features">
            <div class="feature">
                <div class="feature-icon">๐Ÿค–</div>
                <h3>AI Agent Integration</h3>
                <p>Built-in MCP server for Claude, ChatGPT, Cursor, VS Code, Gemini CLI, and any MCP-compatible agent.</p>
            </div>
            <div class="feature">
                <div class="feature-icon">๐Ÿ”ฅ</div>
                <h3>Real-Time Streams</h3>
                <p>WebSocket support for live ticker, trades, order book, and private order updates.</p>
            </div>
            <div class="feature">
                <div class="feature-icon">๐Ÿ“Š</div>
                <h3>Market Data</h3>
                <p>OHLCV, order books, tickers, summaries, and price increments at your fingertips.</p>
            </div>
            <div class="feature">
                <div class="feature-icon">๐Ÿ’ฐ</div>
                <h3>Account &amp; Trading</h3>
                <p>Check balances, place orders, view history, and manage your portfolio.</p>
            </div>
            <div class="feature">
                <div class="feature-icon">๐Ÿงช</div>
                <h3>Paper Trading</h3>
                <p>Simulated trading environment with virtual balances to test strategies risk-free.</p>
            </div>
            <div class="feature">
                <div class="feature-icon">๐Ÿ””</div>
                <h3>Price Alerts</h3>
                <p>Set price alerts and monitor in real-time via WebSocket. Never miss a trading opportunity!</p>
            </div>
            <div class="feature">
                <div class="feature-icon">๐Ÿ”</div>
                <h3>Secure Auth</h3>
                <p>HMAC-SHA512 signing with 0600-permission config files and env variable support.</p>
            </div>
        </div>
    </div>
</section>

<section id="installation">
    <div class="container">
        <h2>๐Ÿ“ฆ Installation</h2>
        <p>Requires <a href="https://rustup.rs/">Rust</a>. Install from source in seconds:</p>
        <pre><code>git clone https://github.com/ibidathoillah/indodax-cli.git
cd indodax-cli
cargo install --path .</code></pre>
        <p>Or build locally:</p>
        <pre><code>cargo build --release
./target/release/indodax --help</code></pre>
    </div>
</section>

<section id="quickstart">
    <div class="container">
        <h2>๐Ÿš€ Quick Start</h2>

        <h3>1. Check Market Data <span style="color: var(--success);">(No API Key Needed)</span></h3>
        <pre><code>indodax market server-time
indodax market ticker btc_idr
indodax market orderbook btcidr
indodax market pairs</code></pre>

        <h3>2. Set API Credentials (For Account &amp; Trading)</h3>
        <pre><code>indodax auth set --api-key YOUR_API_KEY --api-secret YOUR_API_SECRET</code></pre>
        <p>Or use environment variables for CI/CD:</p>
        <pre><code>export INDODAX_API_KEY=your_api_key
export INDODAX_API_SECRET=your_api_secret</code></pre>

        <h3>3. Check Your Account</h3>
        <pre><code>indodax account balance
indodax account info</code></pre>

        <h3>4. Start the Interactive Shell</h3>
        <pre><code>indodax shell</code></pre>
    </div>
</section>

<section id="mcp">
    <div class="container">
        <h2>๐Ÿค– MCP Server</h2>
        <p>indodax-cli includes a built-in <strong>Model Context Protocol (MCP)</strong> server over stdio. No subprocess wrappers needed.</p>
        <p>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.</p>

        <div class="warning">
            <strong>โš ๏ธ Warning</strong>
            <p>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 <strong>not</strong> expose, tunnel, or share this server outside systems you control. Always use <code>https://</code> and <code>wss://</code> endpoints. Treat this integration as alpha and use <strong>least-privilege API keys</strong>.</p>
        </div>

        <h3>Usage</h3>
        <pre><code>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</code></pre>

        <h3>Service Groups</h3>
        <table>
            <tr><th>Group</th><th>Tools</th><th>Auth</th><th>Dangerous</th></tr>
            <tr><td><code>market</code></td><td>Server time, ticker, pairs, orderbook, trades, OHLC, price increments</td><td>No</td><td>No</td></tr>
            <tr><td><code>account</code></td><td>Balance, open orders, order history, trade history, account info</td><td>Yes</td><td>No</td></tr>
            <tr><td><code>trade</code></td><td>Buy, sell, cancel orders</td><td>Yes</td><td><strong>Yes</strong></td></tr>
            <tr><td><code>funding</code></td><td>Withdraw fees, withdraw crypto</td><td>Yes</td><td><strong>Yes</strong></td></tr>
            <tr><td><code>paper</code></td><td>Paper trading init, balance, buy, sell, orders, cancel, history, status</td><td>No</td><td>No</td></tr>
            <tr><td><code>auth</code></td><td>Show config, test credentials</td><td>Varies</td><td>No</td></tr>
        </table>

        <h3>Configure Your MCP Client</h3>
        <p>Add to your MCP client configuration:</p>

        <p><strong>Claude Desktop</strong> (<code>claude_desktop_config.json</code>):</p>
        <pre><code>{
  "mcpServers": {
    "indodax": {
      "command": "indodax",
      "args": ["mcp", "-s", "all"]
    }
  }
}</code></pre>

        <p><strong>VS Code / Cursor</strong> (<code>.vscode/mcp.json</code> or Cursor MCP settings):</p>
        <pre><code>{
  "mcpServers": {
    "indodax": {
      "command": "indodax",
      "args": ["mcp", "-s", "all"]
    }
  }
}</code></pre>

        <p><strong>Gemini CLI</strong>:</p>
        <pre><code>gemini extensions install https://github.com/ibidathoillah/indodax-cli</code></pre>
    </div>
</section>

<section id="commands">
    <div class="container">
        <h2>๐Ÿ“– Commands</h2>

        <h3>Market Data (Public API)</h3>
        <table>
            <tr><th>Command</th><th>Description</th></tr>
            <tr><td><code>market server-time</code></td><td>Get server time</td></tr>
            <tr><td><code>market pairs</code></td><td>List available trading pairs</td></tr>
            <tr><td><code>market ticker &lt;pair&gt;</code></td><td>Get ticker for a pair</td></tr>
            <tr><td><code>market ticker-all</code></td><td>Get tickers for all pairs</td></tr>
            <tr><td><code>market summaries</code></td><td>Get 24h and 7d summaries</td></tr>
            <tr><td><code>market orderbook &lt;pair&gt;</code></td><td>Get order book</td></tr>
            <tr><td><code>market trades &lt;pair&gt;</code></td><td>Get recent trades</td></tr>
            <tr><td><code>market ohlc</code></td><td>Get OHLCV candle data</td></tr>
        </table>

        <h3>Account (Private API)</h3>
        <table>
            <tr><th>Command</th><th>Description</th></tr>
            <tr><td><code>account info</code></td><td>Get account information</td></tr>
            <tr><td><code>account balance</code></td><td>Show wallet balances</td></tr>
            <tr><td><code>account open-orders</code></td><td>List open orders</td></tr>
            <tr><td><code>account order-history</code></td><td>Get order history (v2 API)</td></tr>
            <tr><td><code>account trade-history</code></td><td>Get trade fill history (v2 API)</td></tr>
        </table>

        <h3>Trading (Private API)</h3>
        <table>
            <tr><th>Command</th><th>Description</th></tr>
            <tr><td><code>trade buy</code></td><td>Place a buy order</td></tr>
            <tr><td><code>trade sell</code></td><td>Place a sell order</td></tr>
            <tr><td><code>trade cancel</code></td><td>Cancel an order by ID</td></tr>
            <tr><td><code>trade countdown</code></td><td>Deadman switch countdown</td></tr>
        </table>

        <h3>WebSocket Streaming</h3>
        <table>
            <tr><th>Command</th><th>Description</th></tr>
            <tr><td><code>ws ticker &lt;pair&gt;</code></td><td>Stream real-time ticker</td></tr>
            <tr><td><code>ws trades &lt;pair&gt;</code></td><td>Stream real-time trades</td></tr>
            <tr><td><code>ws book &lt;pair&gt;</code></td><td>Stream real-time order book</td></tr>
            <tr><td><code>ws orders</code></td><td>Stream private order updates</td></tr>
        </table>
    </div>
</section>

<section id="output">
    <div class="container">
        <h2>๐Ÿ“ Output Formats</h2>
        <p>Human-friendly tables by default, or JSON for automation and AI agent consumption.</p>
        <pre><code># Table mode (default)
indodax market ticker btc_idr

# JSON mode
indodax -o json market ticker btc_idr</code></pre>
        <p>When an error occurs in JSON mode, a structured error envelope is returned:</p>
        <pre><code>{
  "error": true,
  "message": "Invalid trading pair: xxx_idr",
  "error_type": "invalid_pair",
  "retryable": false
}</code></pre>
    </div>
</section>

<section id="paper">
    <div class="container">
        <h2>๐Ÿงช Paper Trading</h2>
        <p>Test strategies with virtual balances before risking real funds.</p>
        <pre><code># 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</code></pre>
    </div>
</section>

<section id="alerts">
    <div class="container">
        <h2>๐Ÿ”” Price Alerts</h2>
        <p>Set price alerts and get notified when conditions are met. Monitor in real-time via WebSocket.</p>
        <pre><code># 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</code></pre>
    </div>
</section>

<section id="security">
    <div class="container">
        <h2>๐Ÿ” Security</h2>
        <p>Indodax uses HMAC-SHA512 signing. Credentials are resolved in priority order:</p>
        <ol>
            <li>CLI flags (<code>--api-key</code>, <code>--api-secret</code>)</li>
            <li>Environment variables (<code>INDODAX_API_KEY</code>, <code>INDODAX_API_SECRET</code>)</li>
            <li>Config file (<code>~/.config/indodax/config.toml</code> with <code>0600</code> permissions)</li>
        </ol>
    </div>
</section>

<footer>
    <div class="container">
        <p>Built with Rust. Not affiliated with or endorsed by Indodax.</p>
        <p><a href="https://github.com/ibidathoillah/indodax-cli">GitHub</a> ยท MIT License</p>
    </div>
</footer>

</body>
</html>