Commands
| Command | Description |
|---|---|
health | Check API server status |
trade <prompt> | Execute a spot swap via natural language |
perp <prompt> | Execute a perpetual trade |
portfolio | Show portfolio balances and positions |
timeboost [prompt] | Query TimeBoost express lane |
chat | Start the interactive REPL |
Examples
Interactive REPL
Thechat command starts a persistent REPL session with multi-turn thread
context. Each prompt in the session is sent with the same threadId, allowing
the agent to reference previous messages:
Thread context is maintained for the duration of the REPL session. Exiting
with
exit, quit, or Ctrl+C ends the session and discards the thread
reference.Authentication
The CLI supports API key authentication via a flag or environment variable:| Method | Usage |
|---|---|
| Flag | arb --api-key <key> trade "swap ETH" |
| Environment | ARB_API_KEY=<key> arb trade "swap ETH" |
Bearer token in the Authorization header.
Global Flags
| Flag | Description |
|---|---|
--api-url <url> | Override the API server URL |
--api-key <key> | Set the API key for authenticated requests |
Environment Variables
| Variable | Default | Description |
|---|---|---|
ARB_API_URL | http://localhost:3000 | API server URL |
ARB_API_KEY | (empty) | API key for auth |
API Communication
All commands follow the same request lifecycle:1. Submit prompt
1. Submit prompt
POST /agent/prompt with a JSON body containing the prompt text and an
optional threadId (REPL mode only). Returns a jobId.2. Poll for result
2. Poll for result
GET /agent/job/{jobId} polled every 2 seconds until the job reaches a
terminal state (complete, failed, or cancelled). Timeout is 120
seconds.3. Display result
3. Display result
Completed jobs display the
result.text field. Failed jobs display the
error message. In REPL mode, a spinner animates during both the submission
and polling phases.Setup
Install and run
Install and run
The CLI entry point is a Bun script:To use it as a global
arb command, link the binary:Point to a remote API
Point to a remote API
Terminal Output
The CLI uses ANSI color codes for readable terminal output:| Element | Color |
|---|---|
| Brand text | Cyan + bold |
| Success messages | Green |
| Error messages | Red |
| Dim / help text | Dim gray |