CLI Commands
The CLI ships ~20 commands grouped into four areas: auth & account, strategies & deployment, data & analysis, and maintenance.
Coming soon: tradectl lab
The local lab dashboard (port 9200) will be launched as tradectl lab from the next CLI release. Today, build and run the standalone tradectl-lab binary — see tradectl-lab.
Auth & account
tradectl login
Authenticate with the platform using an API key (read it from stdin to avoid leaking it into shell history):
echo "st_live_<your-key>" | tradectl loginExchanges the API key for a signed JWT license token (Ed25519, 72 h expiry). The token is cached locally and refreshed automatically.
tradectl logout
Clears the cached license token.
tradectl logouttradectl auth
Manage exchange API credentials. Supported providers: binance, bybit, okx, hyperliquid, htx, gate, bitget.
tradectl auth set binance # interactive — prompts for key/secret/passphrase
tradectl auth list # list configured exchanges
tradectl auth remove binance # remove credentials for an exchangeOKX and Bitget additionally prompt for a passphrase. Hyperliquid uses an API wallet's address + private key.
Strategies & deployment
tradectl init <name>
Scaffold a new strategy crate.
tradectl init my-strategyCreates a Rust project with src/lib.rs, src/params.rs, config.json, a unit test, and a STRATEGY.md template. The SDK dependency is resolved automatically (local path or crates.io).
tradectl build
Compile the current strategy crate to a cdylib.
tradectl build # release build of cdylibProduces target/release/lib<name>.so (Linux), lib<name>.dylib (macOS), or <name>.dll (Windows). Cargo converts dashes to underscores in the cdylib name.
tradectl run <config>
Run a strategy. Paper or live is selected by isEmulator in the config.
tradectl run config.json
tradectl run config.json --daemon # detach as background process
tradectl run config.json --dry-run # validate config + load plugin, do not start
tradectl run config.json --replay data/prepared.bin # historical replay| Flag | Description |
|---|---|
<CONFIG> | Path to bot config (positional) |
--daemon | Run in background as a detached process |
--dry-run | Validate config and load strategy without starting trading |
--replay <FILE> | Replay a prepared .bin data file instead of connecting live |
tradectl stop
Stop a running bot.
tradectl stop config.json # stop a specific bot
tradectl stop all # stop all bots managed by this CLICancels active entry orders. Exits remain on the exchange and positions stay open — protected by their TP/SL until they fire or you close them manually.
tradectl strats
List installed strategy plugins (scans ~/.tradectl/lib/).
tradectl stratstradectl install <strategy>
Download a strategy from the marketplace. The CLI verifies the SHA256 of the binary against the platform's record before writing.
tradectl install shot-scalpertradectl upload
Register the current strategy with your platform account.
tradectl upload # register source
tradectl upload --binary # also upload the compiled binaryData & analysis
tradectl backtest
Run a local backtest against a prepared data file.
tradectl backtest \
-d data/prepared.bin \
--balance 10000 \
--leverage 5 \
--taker-fee 0.0004 \
-p order_size=0.001 \
-v| Flag | Description | Default |
|---|---|---|
-d, --data <PATH> | Prepared data file (.bin, .parquet, .csv, or .jsonl) | required |
--balance <FLOAT> | Initial balance (USD) | 10000 |
--leverage <FLOAT> | Leverage multiplier | 1.0 |
--taker-fee <FLOAT> | Taker fee rate | 0.0004 |
--maker-fee <FLOAT> | Maker fee rate | 0.0002 |
--slippage <FLOAT> | Slippage as a fraction | 0.0001 |
-p, --param <KEY=VAL> | Strategy parameter (repeatable) | — |
-v, --verbose | Print individual trades | false |
--bench | Profile latency / throughput / pipeline breakdown | false |
tradectl sweep
Parameter sweep — Cartesian product of ranges, ranked by score.
tradectl sweep \
-d data/prepared.bin \
-r entryDistance=0.5:3.0:0.1 \
-r takeProfit=0.3:1.5:0.1 \
-p order_size=0.001 \
--top 20 \
--min-trades 5| Flag | Description | Default |
|---|---|---|
-d, --data <PATH> | Prepared data file | required |
-r, --range <KEY=MIN:MAX:STEP> | Range to sweep (repeatable) | required |
-p, --param <KEY=VAL> | Fixed parameter (repeatable) | — |
--balance / --leverage / --taker-fee / --maker-fee / --slippage | Same as backtest | — |
--top <N> | Show top N results | 20 |
--min-trades <N> | Minimum trades to be eligible | 5 |
-o, --output <PATH> | Save results as JSON | — |
tradectl prepare
Prepare raw market data into the optimized format.
tradectl prepare \
--root data/raw \
--exchange binance \
--symbol BTCUSDT \
--interval 2026-01-01:2026-02-01 \
-o data/prepared.bin| Flag | Description |
|---|---|
--root <DIR> | Raw data directory |
--exchange <NAME> | Source exchange (binance, bybit, ...) |
--symbol <SYM> | Symbol to prepare |
--interval <RANGE> | Date range (YYYY-MM-DD:YYYY-MM-DD) |
--ticker-data <PATH> | Or supply a single bookTicker file directly |
--trade-data <PATH> | Or supply a single trades file directly |
--trades-only | Synthesize tickers when bookTicker is unavailable |
--ticker-bucket-ms <N> | Synthesis bucket size (default 100) |
--buffer-ms <N> | Windowing buffer (default 20, 0 = off) |
-o, --output <PATH> | Output (.bin or .parquet) |
The CLI emits the TCTL v3 binary format — single-file pack of ticker / trade / kline / depth streams with a footer index for mmap loading. Load time: ~18 µs for the binary format vs ~360 ms for parquet.
tradectl collect
Live WebSocket recorder — captures market data into compressed JSONL files.
tradectl collect binance --symbols BTCUSDT,ETHUSDT --output data/raw/Writes zstd-compressed .jsonl.zst files. Use tradectl prepare afterward to roll them into the binary format.
tradectl monitor
Connect to a running bot's MonitorBroadcaster (port 9100 by default) and stream events to the terminal. The full UI lives in tradectl-lab at /monitor.
tradectl monitor --url localhost:9100Maintenance
tradectl config validate
Validate a bot config file without starting it.
tradectl config validate config.jsontradectl run config.json --dry-run does the same thing plus loads the strategy plugin to verify ABI compatibility.
tradectl mcp
Stdio proxy for the bot's embedded MCP server (port 9101). Used to register the bot as an MCP server in Claude Code:
claude mcp add tradectl-bot -- tradectl mcpSee MCP Server.
tradectl update
Update the CLI binary in place from the GitHub Releases channel.
tradectl updateComing soon
tradectl lab— launch the local lab dashboard (port 9200) directly from the CLI. Until then, run the standalone binary as described in tradectl-lab.
