Skip to content

CLI Command Reference

Every command the tokenbot CLI ships. Run tokenbot --help, or tokenbot <command> --help, to see the same information from the binary itself.


FlagDescription
--jsonOutput results as JSON for piping to other tools
--config <path>Override the config directory (sets TOKENBOT_HOME)
--versionPrint the CLI version
--helpShow help for any command

--json always emits a well-formed array — [] when empty — so scripts never need to special-case the no-rows path. It also suppresses incidental human-facing text, keeping stdout valid JSON.


Generate a CLI identity and register it with TokenBot.

FlagDescription
--api-url <url>Override the TokenBot API URL
--ws-url <url>Override the TokenBot WebSocket URL
--label <label>Human-friendly label for this CLI identity
Terminal window
tokenbot init --label "work laptop"

Print the active CLI identity and server-side account info.

Confirm the CLI identity is configured. Use tokenbot init to register a new one.

Delete the local CLI config and encrypted key store.


Manage local-only exchange API credentials. These are encrypted in ~/.tokenbot/keys.json and never transmitted.

SubcommandFlagsDescription
add--strategy <id>, --copier <id>, --exchange <name>Add or replace a credential, bound to a strategy or copier
list—List all stored credential labels
remove <label>—Delete the credential stored under <label>
Terminal window
tokenbot keys add --exchange binance --strategy strat_9f

Fetch exchange balances locally via ccxt, using credentials from keys.

FlagDescription
--strategy <id>Show balance for this strategy
--copier <id>Show balance for this copier
--allShow balances for every stored credential

Manage trading strategies. A Strategy is the leader that copiers follow.

SubcommandFlagsDescription
list—List all strategies you own
show <id>—Show a single strategy as JSON
add--name, --description, --exchange-account-id, --publicCreate a strategy (interactive)
delete <id>—Delete a strategy (double-confirm)

Columns: id, name, status, active, public, exchange.

Manage copy-trading subscriptions. A Copier follows a Strategy.

SubcommandFlagsDescription
list—List all copiers you own
show <id>—Show a single copier as JSON
add--strategy, --exchange-account-id, --name, --allocation <0-100>Create a copier (interactive)
delete <id>—Delete a copier (double-confirm)

Columns: id, name, strategy, exchange, status, active, allocation %.

Bind and inspect the copier↔strategy relationship. Both link and unlink take flags, not positional ids, and both flags are required.

CommandFlagsDescription
link--strategy <id>, --copier <id>Bind a copier to a strategy
unlink--strategy <id>, --copier <id>Detach a copier from a strategy
links list—List every copier alongside the strategy it follows
Terminal window
tokenbot link --copier cop_2d10 --strategy strat_9f

unlink requires --strategy for clarity even though the copier id is the lookup key.


List trades executed on your account.

FlagDescription
--strategy <id>Only trades from this strategy
--symbol <pair>Only trades for this pair (e.g. BTC/USDT)
--side <side>Filter by side: buy or sell
--since <date>Executed on or after this date
--until <date>Executed on or before this date
--limit <n>Maximum rows to show
--page <n>Page past the first --limit rows

Columns: executed (utc), symbol, side, status, qty, price, pnl, strategy, id.

Ids are shortened for display; --json carries the full values.


Manage server-side exchange account links. Distinct from keys, which is local-only — see Exchange Accounts.

SubcommandFlagsDescription
list—List your registered exchange accounts
add--exchange, --account-name, --trading-typeRegister an exchange account (interactive)
supported—List exchanges the server will connect to

--trading-type accepts spot, margin or perpetual.


Manage outbound webhook endpoints.

SubcommandFlagsDescription
list—List all webhook endpoints
add--url, --events, --descriptionRegister an endpoint (--events is comma-separated)
remove <id>—Delete an endpoint (double-confirm)
test <id>—Send a test event to an endpoint

Manage server-side API keys — for your own integrations against the REST and GraphQL APIs. The CLI itself does not authenticate with these; it signs requests with your identity key.

SubcommandFlagsDescription
list—List active keys (without secrets)
create--name, --description, --env, --permissionsCreate a key — the secret prints exactly once
revoke <id>—Revoke a key (double-confirm)

--env accepts live or test and defaults to live. --permissions is comma-separated.


SubcommandDescription
showShow the rewards summary
referPrint your referral code