APIs, Bots & Automation

How to Use the Open-Source Quote.Trade Command-Line Trading Client

Clone the official Quote.Trade CLI, build it, copy sample.env, and start in MODE=paper. Confirm market data, positions, risk, and local triggers before enabling real orders. Local trigger orders work only while the CLI is running.

45 minutesAdvancedTechnical traders and developers

What you will accomplish

  • Build and verify the official CLI
  • Configure paper mode without committing secrets
  • Understand how local L2 triggers use bid and ask depth
  • Check positions and risk before real mode

Before you begin

  • Node.js and npm
  • Git
  • A secure terminal environment
  • Read-only credentials for private-state testing; live trading credentials only after review
Confirm paymentCurrency before real mode

The current CLI and Telegram repositories may default DEFAULT_PAYMENT_CURRENCY to USD, while the authenticated order reference treats paymentCurrency as a separate field and illustrates stablecoins such as USDT. Before enabling real mode, use the value accepted by the current account and order schema. Do not infer the funding asset from quoteAsset=USD.

Current main-branch Candle regression

The public CLI has worked before: commit e66154b4 builds cleanly. The May 31, 2026 upload at 4ebdf05d removed the Candle export from src/types.ts while candle-aggregator.ts still imports it. This is a current source regression, not a conclusion about the CLI's history. Use the tested repair in Troubleshooting until the repository is corrected.

DefaultMODE=paper
TriggersLocal; bot must remain running
Depth ruleBUY uses asks; SELL uses bids
Repository statusCurrent main needs the documented Candle repair
Advanced triggersMay be implemented locally by the running client
paymentCurrencyCheck the current live order fields before real mode
Step-by-step

Clone, build, and verify the repository

Use the official quoteTrade organization repository and record the commit you tested. Install dependencies, compile, and print the CLI help. The current package's npm test script names test files that are not present in the public repository, so do not claim that suite passed unless those files are restored.

Quote.Trade documentation link to the full open-source CLI Trading Bot project on GitHub
The official documentation links directly to the open-source CLI Trading Bot repository.
bash
git clone https://github.com/quoteTrade/quote-trade-CLI-trading-bot.git
cd quote-trade-CLI-trading-bot
npm install
npm run build
npm run help
Expected result

The project builds and the help command runs without placing an order.

Configure paper mode first

Copy sample.env and preserve MODE=paper. The official sample points to Quote.Trade REST, liquidity, and private listen-key URLs. Keep credentials empty for public tests or inject them securely for read-only private tests.

bash
cp sample.env .env

Then edit .env and keep paper mode enabled:

dotenv


API_BASE_URL=https://app.quote.trade/api
LIQUIDITY_WS_URL=wss://app.quote.trade/ws/liquidity
LISTEN_KEY_WS_URL=wss://app.quote.trade/ws/listenKey
MODE=paper
TRADE_API_KEY=
TRADE_API_SECRET=
SIGNING_ALGORITHM=sha256
QUOTE_TRADE_STATE_DIR=.quote-trade
POSITIONS_ENDPOINT=/positions
Expected result

The CLI starts in paper mode and does not submit live orders.

Inspect positions and risk

The repository caches positions in .quote-trade/positions.json and can refresh from current account interfaces. Review the state directory’s permissions and do not publish it.

bash
npm run cli -- positions:refresh
npm run cli -- positions:list
npm run cli -- risk
Expected result

The CLI displays current or paper account state and risk without placing an order.

Create a paper L2 trigger

The CLI’s local trigger engine is side- and quantity-aware: BUY triggers evaluate ask-side depth; SELL triggers evaluate bid-side depth. It fires only when cumulative executable depth covers the resolved order quantity.

bash
npm run cli -- trigger:limit \
  --symbol BTC \
  --side BUY \
  --price 60000 \
  --quantity 0.01

npm run cli -- trigger:list
npm run cli -- trigger:watch
Expected result

The trigger is stored locally and a paper action is logged only when its price and depth conditions are met.

Know that local triggers stop when the CLI stops

The API does not receive native trigger instructions in advance. The watcher must remain running for local triggers, OCO, bracket, trailing-stop, time, and risk-guard actions to fire. Monitor process health and restart behavior.

Expected result

Local triggers work only while the CLI process is running.

Enable real mode only after testing the full workflow

Before MODE=real, use a dedicated limited key, verify symbol and notional controls, test the kill switch, confirm current positions, and use the smallest practical order. The optional LLM planner creates a draft; it does not replace confirmation.

Expected result

Real mode is enabled only after credentials, limits, and the full workflow have been tested.

Troubleshooting

Common problems and fixes

Build fails because Candle is not exported from ../types

On current main commit 4ebdf05d, restore a compatible type in src/types.ts, then rerun npm run build. This minimal repair was compiled successfully:

typescript
export interface Candle { start: number; end: number; open: number; high: number; low: number; close: number; orderBook?: unknown; }
npm test cannot find tests/trigger-engine.test.js

The current public package references four test files that are not included in the repository. This is a separate packaging issue. Use the compile and help smoke tests above, plus paper-mode checks, until the repository ships the referenced tests or updates its test script.

A local stop did not fire

Confirm trigger:watch was running, fresh L2 data was available, and cumulative side-specific depth covered the required quantity.

Position-sized close has no quantity

Refresh and inspect the local position cache before arming the trigger.

An LLM proposed an unsafe command

Do not confirm it. Treat the planner output as a draft and require hard-coded validation rules plus user review.

Primary sources

Ready for the next step?

Open the CLI repository

Open the CLI repository