CLI API
TradeJS command-line interface is exposed as the @tradejs/cli package.
Use it directly after package install via npx @tradejs/cli <command>.
Core Commands
npx @tradejs/cli doctor
npx @tradejs/cli infra-init
npx @tradejs/cli infra-up
npx @tradejs/cli infra-down
npx @tradejs/cli backtest
npx @tradejs/cli signals
npx @tradejs/cli signals-summary
npx @tradejs/cli runtime-parity
npx @tradejs/cli bot
npx @tradejs/cli results
ML Commands
npx @tradejs/cli ml-export
npx @tradejs/cli ml-inspect
npx @tradejs/cli ml-train:latest
npx @tradejs/cli ml-train:trendline:xgboost
AI Commands
npx @tradejs/cli ai-export
npx @tradejs/cli ai-train -n 50 --minQuality 4
Backtest Flags
npx @tradejs/cli backtest --help supports key flags:
-c, --configbacktest config key (default:breakout)-t, --tickerscustom symbol list-e, --excludeexclude symbols-n, --testsmax tests-p, --parallelworker count-u, --updateOnlyupdate market cache only-C, --cacheOnlydo not refresh market cache-m, --mlwrite ML rows to dataset chunks-A, --aiwrite AI prompt rows to dataset chunks
AI Train Flags
npx @tradejs/cli ai-train --help:
-n, --recentevaluate the latest N trades from the end (0= all rows)--minQualityminimum AI quality threshold for approval-s, --strategyselect latest merged dataset for one strategy-f, --fileevaluate an explicit merged dataset file
Signals Flags
npx @tradejs/cli signals --help:
-t, --tickers-e, --exclude-m, --makeOrders-N, --notifysend Telegram notifications-u, --updateOnly-C, --cacheOnly-c, --chunkchunk mode like1/3
Signals Summary Flags
npx @tradejs/cli signals-summary --help:
-u, --userselect the Redis user that owns Telegram settings and runtime journal data--connectorchoose the connector used for trade reconciliation-H, --hourssize of the digest window in hours (24by default)-P, --printOnlyprint the digest instead of sending it to Telegram
Runtime Parity Flags
npx @tradejs/cli runtime-parity --help:
-u, --userselect the Redis user config and runtime journal-o, --connectorconnector provider/name for parity replay-d, --daysrecent replay window in days--startTimeand--endTimeexplicit replay window timestamps-s, --strategycompare one strategy only-t, --tickersreplay comma-separated symbols for configured strategies-C, --cacheOnlydo not refresh market history before replay--toleranceBarsallowed entry timestamp drift in bars--runtimeGatesreplay with configured runtime AI/ML gates enabled-D, --detailsprint unmatched entry details-N, --notifysend the parity summary to Telegram
Doctor Flags
npx @tradejs/cli doctor --help:
--require-mlmake ML gRPC check mandatory--skip-mlskip ML gRPC check
Deep Dives
- Grid config for backtests - how to define Redis grid configs for mass parameter search
- Results and runtime promotion - promoting backtest configs with
@tradejs/cli results,isConfigFromBacktest - Runtime Parity - comparing runtime entry records with deterministic backtest replay
- Data Sync - data refresh via
continuityandbacktest --updateOnly