Skip to content

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):

bash
echo "st_live_<your-key>" | tradectl login

Exchanges 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.

bash
tradectl license             # what this machine has
tradectl license --refresh   # ask tradectl.com again first

tradectl logout ​

Clears the cached license token.

bash
tradectl logout

tradectl auth ​

Manage exchange API credentials. Supported providers: binance, bybit, okx, hyperliquid, htx, gate, bitget.

bash
tradectl auth set binance     # interactive — prompts for key/secret/passphrase
tradectl auth list            # list configured exchanges
tradectl auth remove binance  # remove credentials for an exchange

OKX 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.

bash
tradectl init my-strategy

Creates 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.

bash
tradectl build              # release build of cdylib

Produces 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.

bash
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
FlagDescription
<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)
--daemonRun in background as a detached process
--dry-runValidate 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.

bash
tradectl stop my-bot          # stop one bot
tradectl stop all             # stop all bots managed by this CLI

The 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).

bash
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 service

Use watchdog as the name for the watchdog.

tradectl strats ​

List installed strategy plugins (scans ~/.tradectl/lib/).

bash
tradectl strats

tradectl install <strategy> ​

Download a strategy from the marketplace. The CLI verifies the SHA256 of the binary against the platform's record before writing.

bash
tradectl install shot

tradectl upload ​

Register the current strategy with your platform account.

bash
tradectl upload              # register source
tradectl upload --binary     # also upload the compiled binary

Data & analysis ​

tradectl backtest ​

Run a local backtest against a prepared data file.

bash
tradectl backtest \
  -d data/prepared.bin \
  --balance 10000 \
  --leverage 5 \
  --taker-fee 0.0004 \
  -p order_size=0.001 \
  -v
FlagDescriptionDefault
-d, --data <PATH>Prepared data file (.bin, .parquet, .csv, or .jsonl)required
--balance <FLOAT>Initial balance (USD)10000
--leverage <FLOAT>Leverage multiplier1.0
--taker-fee <FLOAT>Taker fee rate0.0004
--maker-fee <FLOAT>Maker fee rate0.0002
--slippage <FLOAT>Slippage as a fraction0.0001
-p, --param <KEY=VAL>Strategy parameter (repeatable)—
-v, --verbosePrint individual tradesfalse
--benchProfile latency / throughput / pipeline breakdownfalse

tradectl sweep ​

Parameter sweep — Cartesian product of ranges, ranked by score.

bash
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
FlagDescriptionDefault
-d, --data <PATH>Prepared data filerequired
-r, --range <KEY=MIN:MAX:STEP>Range to sweep (repeatable)required
-p, --param <KEY=VAL>Fixed parameter (repeatable)—
--balance / --leverage / --taker-fee / --maker-fee / --slippageSame as backtest—
--top <N>Show top N results20
--min-trades <N>Minimum trades to be eligible5
-o, --output <PATH>Save results as JSON—

tradectl prepare ​

Prepare raw market data into the optimized format.

bash
tradectl prepare \
  --root data/raw \
  --exchange binance \
  --symbol BTCUSDT \
  --interval 2026-01-01:2026-02-01 \
  -o data/prepared.bin
FlagDescription
--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-onlySynthesize 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.

bash
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.

bash
tradectl config validate config.json

tradectl 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:

bash
claude mcp add tradectl-bot -- tradectl mcp

See MCP Server.

tradectl telegram ​

Link your account to the shared Telegram bot, @tradectlbot. See Telegram.

bash
tradectl telegram link

tradectl 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.

bash
tradectl update