CLI Commands
The CLI ships ~20 commands grouped into four areas: auth & account, strategies & deployment, data & analysis, and maintenance.
Traders do not need the CLI: the Lab runs bots on your computer, and the install command sets up a server. Run tradectl <command> --help for every flag.
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 license (Ed25519 JWT). The license is short-lived; the CLI and running bots refresh it by themselves.
On a server, tradectl login --setup-code ABCDE-FGHJK logs in with a one-time code from the Lab (Profile → add a server). The server gets its own key. The install command does this for you, and also gives the server your pair key.
tradectl license
Show your plan: tier, paid period, paid bots and the Free limits.
tradectl license # what this machine has
tradectl license --refresh # ask tradectl.com again firsttradectl 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 <bot>
Run a bot. Each bot has a name and its own folder, ~/.tradectl/bot/<bot>/, where it keeps its config. Paper or live is set per strategy by isEmulator.
tradectl run my-bot # foreground
tradectl run my-bot --daemon # detach as a background process
tradectl run my-bot -c config.json # copy config.json into the bot's folder, then run
tradectl run my-bot --dry-run # validate config + load plugin, do not start
tradectl run my-bot --replay data/prepared.bin # historical replay| Flag | Description |
|---|---|
<BOT> | Bot name: a-z, 0-9, - and _, up to 32 characters |
-c, --config <FILE> | Copy this config into the bot's folder before starting (refuses when the bot's config has changed; --force overwrites) |
--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 |
A bot with no config waits for setup from the Lab.
tradectl stop
Stop a running bot.
tradectl stop my-bot # stop one bot
tradectl stop all # stop all bots managed by this CLIThe bot cancels its orders and closes all its open positions at market price, then exits. This can take up to 3 minutes. Other bots' positions are not touched. A bot that runs as a service is stopped through systemd and stays stopped.
tradectl service
Run a bot, or the watchdog, as a systemd service on Linux: it starts on boot and restarts after a crash (10 s later; after 3 crashes in 10 minutes it stays down).
tradectl service install my-bot # make it a service and start it
tradectl service status my-bot # one line: running or not
tradectl service start my-bot # start it again after a stop or a crash loop
tradectl service remove my-bot # stop it (it closes its positions) and remove the serviceUse watchdog as the name for the watchdog.
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 shottradectl 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.
Maintenance
tradectl config validate
Validate a bot config file without starting it.
tradectl config validate config.jsontradectl run my-bot -c 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 telegram
Link your account to the shared Telegram bot, @tradectlbot. See Telegram.
tradectl telegram linktradectl watchdog
The independent watchdog that guards accounts against positions without a stop. Run it on a separate machine. See Watchdog.
tradectl update
Update the CLI binary in place from the GitHub Releases channel.
tradectl update