Skip to main content
The ouroborai CLI provides both single-command execution and an interactive REPL mode for conversing with the agent directly from your terminal. It communicates with the same Hono API server used by all other clients.

Commands

arb <command> [options]
CommandDescription
healthCheck API server status
trade <prompt>Execute a spot swap via natural language
perp <prompt>Execute a perpetual trade
portfolioShow portfolio balances and positions
timeboost [prompt]Query TimeBoost express lane
chatStart the interactive REPL

Examples

arb health
arb trade "swap 100 USDC for ETH"
arb perp "open 2x long ETH with 500 USDC"
arb portfolio
arb timeboost "express lane status"
arb chat

Interactive REPL

The chat 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:
ouroborai interactive mode
Type your message. Ctrl+C to exit.

arb> swap 100 USDC for ETH
Swapped 100 USDC for 0.0312 ETH via Uniswap V3 (500bps pool).

arb> now supply half of that ETH to Aave
Supplied 0.0156 ETH to Aave V3. Health factor: 2.41.

arb> exit
Goodbye.
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:
MethodUsage
Flagarb --api-key <key> trade "swap ETH"
EnvironmentARB_API_KEY=<key> arb trade "swap ETH"
The API key is sent as a Bearer token in the Authorization header.

Global Flags

FlagDescription
--api-url <url>Override the API server URL
--api-key <key>Set the API key for authenticated requests
Global flags can appear before the command and are parsed before dispatch.

Environment Variables

VariableDefaultDescription
ARB_API_URLhttp://localhost:3000API server URL
ARB_API_KEY(empty)API key for auth
Flags take precedence over environment variables.

API Communication

All commands follow the same request lifecycle:
POST /agent/prompt with a JSON body containing the prompt text and an optional threadId (REPL mode only). Returns a jobId.
GET /agent/job/{jobId} polled every 2 seconds until the job reaches a terminal state (complete, failed, or cancelled). Timeout is 120 seconds.
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

The CLI entry point is a Bun script:
bun run apps/cli/src/index.ts health
To use it as a global arb command, link the binary:
bun link
arb --api-url https://api.ouroborai.com --api-key sk-xxx chat
Or set environment variables:
export ARB_API_URL=https://api.ouroborai.com
export ARB_API_KEY=sk-xxx
arb chat

Terminal Output

The CLI uses ANSI color codes for readable terminal output:
ElementColor
Brand textCyan + bold
Success messagesGreen
Error messagesRed
Dim / help textDim gray
A box-drawing utility formats structured output with borders and headers. The REPL spinner cycles through braille animation frames during async operations.
The chat command is the most powerful mode — it preserves conversation context across turns, so you can issue follow-up instructions like “close half that position” without repeating context.