CLI

The agent, in your shell

The Vectr CLI gives you the agent, prices and token data from your terminal. Ask questions, script the answers, pipe them into anything that runs a command.

Updated

  • 4Commands
  • 22.12+Node
  • MITLicense
  • macOSSupported
  • LinuxSupported
  • WindowsSupported

Get started in minutes

Three steps and you’re in.

1

Install it

Build it from source and link it; there is no npm package.

git clone https://git.vectr.bot/vectr/cli.git vectr-cli
cd vectr-cli && pnpm install && pnpm build
npm link

The only install. Puts the vectr binary on your PATH; npm install works in place of pnpm.

2

Get a key

Create an API key on your profile. It is shown once — save it somewhere safe.

Profile → API keys

Keys act as your wallet, fenced in by the rules on your Security tab.

3

Log in and ask

Point the CLI at the backend once, then talk to the agent.

vectr login --key YOUR_KEY
# then ask it something
vectr agent "top tokens?"

Explore the commands

Four commands. That’s the whole surface.

Full reference

Installation

Node 18 or newer, on macOS, Linux or Windows.

Pick a method

Build once, then upgrade in place; credentials in ~/.vectr survive both.

git clone https://git.vectr.bot/vectr/cli.git vectr-cli
cd vectr-cli && pnpm install && pnpm build
npm link

The only install. Puts the vectr binary on your PATH; npm install works in place of pnpm.

Check it worked

--help lists the commands. Neither of these touches the network.

vectr --version
vectr --help

Source, issues and the full README: git.vectr.bot/vectr/cli.

Authentication

price and tokens read public data and need no key. Anything that reaches the agent does.

The CLI sends your key as an X-API-Key header on every request. Create one on your profile, save it locally; the CLI talks to api.vectr.bot unless you pass --url.

  1. 1Open Profile → API keys and create a key. The full value is shown once; only a preview is stored for display.
  2. 2Save it: vectr login --key vectr_xxxx --url https://api.vectr.bot
  3. 3Ask the agent something. The key resolves to your wallet server-side, so you never pass an address.
Treat it like a private key

A key acts as your wallet. Keep it out of git and revoke it the moment it leaks.

  • Read-only keys can query but never move funds.
  • IP allowlists are checked before any endpoint logic.
  • Recipient allowlists cap where funds can go.
  • Revoking is instant — the key stops validating.

Commands

Signatures, flags and what each one prints.

vectr agent

vectr agent <prompt> [--json] [--model <id>]

API key

Opens a job, polls it until it settles, then prints the answer. Trades come back as a prepared transaction instead of a receipt.

--json
Print the raw job object instead of formatted text
--model <id>
Override the model for this turn
vectr agent
vectr agent "what tokens are trending?"
Thinking...
MOON leads the curve at $0.0843, up 34% today.
AGENT and PULSE follow, both graduated this week.

vectr price

vectr price

No key

USD price of the chain's native coin. Labelled with whatever symbol the backend reports, so it follows the chain.

vectr price
vectr price
ETH $4,182.40

vectr tokens

vectr tokens [-n <limit>] [--search <query>]

No key

Top tokens by market cap, or a name and symbol search. Graduated tokens are tagged in the output.

-n, --limit <n>
How many rows to print (default 10)
--search <query>
Filter by name or symbol instead of ranking
vectr tokens
vectr tokens -n 3
# Symbol Price (USD) Name
1 MOON $0.0843 Moonshot [graduated]
2 AGENT $0.0312 Agent Coin
3 PULSE $0.0129 Pulse

vectr login

vectr login --key <key> [--url <url>]

Local

Writes the key to the local config. Run it again to swap keys or point the CLI at a different backend.

-k, --key <key>
API key from your profile — always starts with vectr_
--url <url>
Backend base URL (default https://api.vectr.bot)
vectr login
vectr login --key vectr_xxxx --url https://api.vectr.bot
Logged in. Run: vectr agent "what tokens are trending?"

Examples

The agent is a command, so it composes like one.

Ask in plain language

Anything the terminal understands works here too.

vectr agent "what is my portfolio worth?"
vectr agent "top 5 tokens by market cap"
vectr agent "who launched MOON?"

Pipe it somewhere

--json prints the whole job object. Commands exit non-zero when a job fails.

vectr agent "top 3 by mcap" --json | jq -r .response
vectr tokens -n 50 > snapshot.txt
# cron: log the native price every hour
vectr price >> prices.log

Configuration

One JSON file, written by vectr login.

Config file
~/.vectr/config.json
Auth header
X-API-Key
Key prefix
vectr_
Default API URL
https://api.vectr.bot
Node
>=22.12 (its commander dependency requires it)
Precedence
~/.vectr/config.json wins over VECTR_API_KEY and VECTR_API_URL

Edit the file directly or re-run vectr login. Switching environments is a matter of swapping the key and URL together, since keys are per backend.

cat ~/.vectr/config.json
{
  "apiKey": "vectr_...",
  "apiUrl": "https://api.vectr.bot"
}

Troubleshooting

Every error the CLI can print, and what it means.

  • vectr: command not found (Windows: 'vectr' is not recognized)

    npm link has not run, or npm's global bin folder is not on PATH. Run npm link inside vectr-cli, check that the folder npm prefix -g prints (its bin on macOS/Linux) is on PATH, and open a new terminal.

  • ERR_REQUIRE_ESM or a syntax error on startup

    Node is older than 22.12, which the CLI's commander dependency requires. Upgrade Node, then run pnpm build again.

  • pnpm: command not found

    Install it with npm install -g pnpm, or run npm install in place of pnpm install; both build the same binary.

  • EACCES: permission denied during npm link

    The global npm folder belongs to root. Do not use sudo: point npm at a folder you own (npm config set prefix ~/.npm-global, then add its bin to PATH) or use a Node version manager.

  • Not logged in. Run: vectr login --key <your-api-key>

    No key in the config. Create one on your profile, then run vectr login. Only agent needs it; price and tokens do not.

  • Invalid key format — keys start with vectr_

    The key was mistyped or truncated. Copy it again from the API keys tab; it is only shown once, so create a fresh one if it is lost.

  • 401: {"statusCode":401,"message":"Invalid or revoked API key",…}

    The key was revoked, or it belongs to a different backend than the one in the config. Keys are per environment.

  • 403: {…"message":"IP <address> is not in this key's allowlist"…}

    The key has an IP allowlist that does not include this machine. Allowlists are set when a key is created, so create a new key for this machine.

  • fetch failed

    The config points at a backend that is down or wrong, usually a dev --url left over. vectr login without --url keeps the old URL, and the config file wins over VECTR_API_URL, so reset it: vectr login --key vectr_xxxx --url https://api.vectr.bot

  • Error: <message> after Thinking

    The agent job failed and the message says why: out of credits, the model busy, or a request already running for this wallet.

  • vectr agent never returns

    The CLI polls with no timeout. Press Ctrl+C; the job keeps running and GET /agent/job/:id returns it later.

  • Assertion failed: !(handle->flags & UV_HANDLE_CLOSING) (Windows)

    An old build exiting through libuv. Pull the latest source and run pnpm build again.

Ready to build?

The CLI and the MCP server hit the same endpoints, with the same guardrails.

See every surface