Skip to content

CLI Troubleshooting

You haven’t run init yet, or you’re pointing at a different config directory.

Terminal window
tokenbot init --label "this machine"
tokenbot whoami

If whoami works but another command doesn’t, check you aren’t passing a different --config (or have TOKENBOT_HOME set in your shell):

Terminal window
echo "$TOKENBOT_HOME"
tokenbot --config ~/.tokenbot whoami

Your identity is encrypted at rest under the passphrase you chose during init. There is no recovery path — if it’s lost, register a new identity with tokenbot init and re-link it to your account.

Every request is signed and carries a timestamp; the server rejects stale ones. If requests fail after your machine has been asleep or your clock has drifted, sync it and retry.

The CLI does not authenticate with an API key. tokenbot apikey manages keys for your own integrations against the REST/GraphQL APIs — they are not used for the CLI’s own auth.


The npm global bin directory isn’t on your PATH:

Terminal window
npm list -g tokenbot
export PATH="$(npm config get prefix)/bin:$PATH"
tokenbot --version
Terminal window
node --version # must be v22.0.0 or newer

The CLI declares engines: { node: ">=22.0.0" }. A CLI installed under an older Node stays bound to it — switch versions first (nvm use 22), then reinstall.


Terminal window
tokenbot --help # every top-level command
tokenbot copier --help # subcommands and flags for one command

The full set is: init, whoami, login, logout, keys, balance, link, unlink, links, strategy, copier, trades, exchange, webhooks, rewards, apikey.

Enum flags accept any casing and are normalised, but the value has to be a real member. The error message lists what’s accepted. For tokenbot trades, --side takes buy or sell.

Some commands take flags rather than positional arguments. link and unlink are the ones that catch people out — both require --copier and --strategy:

Terminal window
tokenbot link --copier cop_2d10 --strategy strat_9f

Listing commands print an explanatory message when there are no rows rather than an empty table. That message is the answer — the command didn’t fail.

Use --json. It always emits a well-formed array, [] included, so you never have to special-case the empty result:

Terminal window
tokenbot trades --limit 100 --json | jq '[.[].pnl | tonumber] | add'

--json also suppresses incidental human-facing text, so stdout stays valid JSON.

Tables shorten long ids for readability. --json always carries the full value.


Terminal window
tokenbot --help
tokenbot <command> --help

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