Skip to content

Getting Started with the TokenBot CLI

TokenBot is CLI-first. tokenbot is the command-line tool you use to manage strategies, copiers, exchange accounts, balances, trades, webhooks and rewards.

There is one user CLI. @tokenbot-org/cli-core, @tokenbot-org/sdk and @tokenbot-org/data-models are libraries on GitHub Packages, not things you install to use TokenBot.


Requires Node.js 22+.

Terminal window
npm install -g tokenbot
Terminal window
tokenbot init --label "work laptop"

This generates a secp256k1 keypair, encrypts it under a passphrase you choose, and registers the public key with TokenBot.

You are not asked for an API key. The CLI authenticates by signing each request with your private key — the key never leaves your machine, and there is no shared secret to paste or leak. API keys (tokenbot apikey) exist for your own programmatic integrations, not for the CLI’s own auth.

Terminal window
tokenbot whoami

Prints the active identity and the account it maps to server-side.

Terminal window
tokenbot strategy list

Empty on a new account — that’s expected. Read-only listing commands say so in words rather than printing a bare empty table.


Every command supports one global flag for machine-readable output:

Terminal window
tokenbot trades # human-readable table (default)
tokenbot trades --json # JSON, for piping to jq

--json always emits a well-formed array — [] when there are no rows — so scripts never need to special-case the empty result.


FlagEffect
--jsonOutput JSON instead of a table
--config <path>Use a different config directory (also settable via TOKENBOT_HOME)
--versionPrint the CLI version
--helpHelp for any command or subcommand

Use --config to keep separate identities side by side:

Terminal window
tokenbot --config ~/.tokenbot-work whoami

PathContents
~/.tokenbot/config.jsonyour CLI identity, encrypted under your passphrase
~/.tokenbot/keys.jsonlocal-only exchange credentials, encrypted, never transmitted

tokenbot logout deletes both.

Note the deliberate split: tokenbot keys add stores credentials locally for commands like tokenbot balance, which call the exchange directly. tokenbot exchange add is a separate path that registers credentials server-side so the platform can act for you. See Exchange Accounts.


Terminal window
tokenbot --help # all commands
tokenbot copier --help # one command and its subcommands

Issues: github.com/tokenbot-org/data-models/issues — the CLI ships from the data-models workspace.