Skip to content

CLI Reference

rax is the artisan command line for Reactive Agents.

Rax stands for Reactive Agents Executable. Think of it as the Reactive Agents equivalent of Laravel’s Artisan CLI.

Use it to scaffold projects, generate agents, run and stream tasks, inspect runtime state, serve A2A endpoints, and deploy across local and cloud targets.

For workflow-first onboarding, start with Rax CLI.

Create a new Reactive Agents project.

Terminal window
rax init <name> [--template minimal|standard|full]

Templates:

All templates install the single unified reactive-agents package — no need to install individual @reactive-agents/* packages separately.

TemplateWhat’s scaffolded
minimalreactive-agents + bare agent that answers questions
standardreactive-agents + adaptive reasoning, tools, observability dashboard
fullreactive-agents + reasoning, tools, memory, guardrails, cost, health check

Generated src/index.ts imports from "reactive-agents" and is runnable immediately after bun install && cp .env.example .env.

Generate an agent file from a recipe, or use --interactive for guided scaffolding.

Terminal window
rax create agent <name> [--recipe basic|researcher|coder|orchestrator]
rax create agent <name> --interactive

Recipes:

RecipeWhat It Generates
basicMinimal agent with LLM only
researcherAgent with memory + reasoning
coderAgent optimized for code tasks
orchestratorMulti-agent orchestrator with memory

Interactive mode:

The --interactive flag launches a readline-based wizard (TTY only) that prompts for:

  1. Agent name — defaults to the first positional argument if you pass one (e.g. rax create agent my-agent --interactive).
  2. Provider — one of anthropic, openai, ollama, or gemini (same set the wizard validates today).
  3. Recipebasic, researcher, coder, or orchestrator.
  4. Features — comma-separated list; default reasoning,tools. This is collected for the session; the generated file is determined only by the recipe (templates live in apps/cli/src/generators/agent-generator.ts). Adjust .withProvider(), .withModel(), and builder flags in the generated source after scaffolding if you need a different stack.
Terminal window
$ rax create agent my-agent --interactive
Create Agent (Interactive)
? Agent name: my-research-agent
? Provider [anthropic/openai/ollama/gemini]: anthropic
? Recipe [basic/researcher/coder/orchestrator]: researcher
? Features (comma-separated) (reasoning,tools): reasoning,tools
Created: src/agents/my-research-agent.ts

Run an agent with a prompt.

Terminal window
rax run <prompt> [--provider anthropic|openai|ollama|gemini|litellm|test]
[--model <model>] [--name <name>] [--tools] [--reasoning] [--stream] [--cortex]

--cortex: Enables .withCortex() on the builder so run lifecycle events are sent to a local Cortex companion studio (WebSocket ingest). Start the studio with rax cortex in another terminal, or set CORTEX_URL to the HTTP base (default http://127.0.0.1:4321). See rax cortex --help for ports, static UI bundle, and env vars.

Example:

Terminal window
rax run "Explain quantum computing" --provider anthropic --model claude-sonnet-4-20250514

Start the Cortex studio: HTTP API, WebSocket /ws/ingest, and the static UI when a bundle is present.

Terminal window
rax cortex [--dev] [--port <n>] [--no-open] [--help]
FlagPurpose
--devStart API + Vite dev UI together (same as cd apps/cortex && bun start). Open http://localhost:5173; Vite proxies /api and /ws to the API port (CORTEX_PORT).
--port <n>API listen port (default 4321). Passed through so the dev UI proxy matches.
VariablePurpose
CORTEX_PORTAPI listen port (default 4321); also read by apps/cortex/ui Vite proxy when using --dev
CORTEX_NO_OPENSet to 1 to skip opening a browser
CORTEX_URLInjected for the child server process so desk runners target the right host
CORTEX_STATIC_PATHDirectory containing built index.html (CLI build:cortex-ui; not used when --dev)

Example:

Terminal window
rax cortex --dev
# other terminal:
rax run "Research topic" --cortex --provider anthropic

Start an agent as an A2A server.

Terminal window
rax serve [--port <number>] [--name <name>] [--provider <provider>] [--model <model>]
[--with-tools] [--with-reasoning] [--with-memory]

Options:

OptionDefaultDescription
--port3000HTTP port for the A2A server
--name"agent"Agent name (used in Agent Card)
--provider"test"LLM provider
--modelModel name
--with-toolsoffEnable built-in tools on the A2A server agent (file-write, web-search, etc.)
--with-reasoningoffEnable reasoning strategies
--with-memoryoffEnable memory. With no extra token: default tier (.withMemory()). Pass enhanced or 2 immediately after the flag for full four-layer memory with embeddings (.withMemory({ tier: "enhanced" })). Optional basic or 1 after the flag keeps the default tier and consumes that token (same behavior as omitting it).

Endpoints served:

  • GET /.well-known/agent.json — Agent Card (A2A discovery)
  • GET /agent/card — Agent Card (fallback)
  • POST / — JSON-RPC 2.0 (message/send, tasks/get, tasks/cancel, agent/card)

Example:

Terminal window
rax serve --name researcher --provider anthropic --model claude-sonnet-4-20250514 --with-tools --port 4000

Fetch and display the Agent Card from a remote A2A-compatible agent server.

Terminal window
rax discover <url>

Fetches GET <url>/.well-known/agent.json and pretty-prints the agent’s name, description, capabilities, and supported skills.

Example:

Terminal window
rax discover http://localhost:3000
Agent Card: researcher
Provider: anthropic (claude-sonnet-4-20250514)
Capabilities: streaming, tools
Skills: web-search, file-write
Endpoint: http://localhost:3000

Deploy an agent using a provider adapter (local Docker, Fly.io, Railway, Render, Cloud Run, DigitalOcean).

Terminal window
rax deploy up [--target local|fly|railway|render|cloudrun|digitalocean]
[--mode daemon|sdk]
[--dry-run]
[--scaffold-only]
[--name <agent-name>]
rax deploy down [--target <target>]
rax deploy status [--target <target>]
rax deploy logs [-f] [--target <target>]
rax deploy init # legacy alias for `deploy up --scaffold-only`

Options:

OptionDefaultDescription
--targetlocal (auto-detected if config exists)Deploy provider adapter
--modedaemondaemon for full agent loop, sdk for HTTP API mode
--dry-runoffRun provider preflight() checks and print execution plan
--scaffold-onlyoffGenerate config files only, do not deploy
--nameauto-detected from package.jsonAgent/app identifier
--follow, -foffFollow logs for deploy logs

Provider CLI Contracts:

These commands and flags are validated by apps/cli/tests/cli-contracts.test.ts to detect upstream CLI breaking changes early.

ProviderCLIContract Baseline
localDocker + ComposeDocker >= 20, Compose >= 2, supports compose build/up/down/ps/logs, up -d, logs --tail/--follow, ps --format
flyflyctl / flysupports auth whoami, launch --copy-config --name --no-deploy, deploy, status, logs, apps destroy --yes
railwayrailwaysupports whoami, link, up, down --yes, status, logs, variables
renderrendersupports blueprint launch, services list
cloudrungcloudSDK >= 380, supports config get-value project, auth list --filter --format, run deploy --source --region --port --memory --timeout --allow-unauthenticated, run services describe/delete/update
digitaloceandoctl>= 1.72, supports account get --format --no-header, apps create/list/update/delete/logs, --spec, --format

Containerized CLI fallback:

For flyctl, gcloud, and doctl, rax deploy resolves local binaries first and can fall back to a Docker-wrapped CLI when Docker is available.

Contract test commands:

Terminal window
bun test apps/cli/tests/cli-contracts.test.ts
RUN_SLOW_TESTS=1 bun test apps/cli/tests/cli-contracts.test.ts

RUN_SLOW_TESTS=1 enables container image availability checks for the fallback images.

Run your local entrypoint in watch mode.

Terminal window
rax dev [--entry src/index.ts] [--no-watch]

Default entrypoint is src/index.ts. Use --entry if your project uses a different file.

Run an evaluation suite (placeholder).

Terminal window
rax eval run --suite <suite-name>

Launch an interactive agent REPL session.

Terminal window
rax playground [--provider <provider>] [--model <model>] [--tools] [--reasoning] [--stream]

Use /help and /exit inside the session.

Inspect local deployment/runtime signals for an agentId.

Terminal window
rax inspect <agent-id> [--logs-tail 200] [--json]

This checks Docker/Compose availability, prints compose status, and scans recent logs for lines containing the provided agentId.

Terminal window
rax version
rax --version
rax -v
Terminal window
rax help
rax --help
rax -h