Documentation Index
Fetch the complete documentation index at: https://docs.cmdclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Bun (recommended) or Node.js
- Docker and Docker Compose
- API keys for the AI providers you want to use (Anthropic, OpenAI, or Google)
Setup
Configure environment variables
.env and fill in your API keys and configuration. At minimum you need:DATABASE_URL— PostgreSQL connection stringREDIS_URL— Redis connection stringANTHROPIC_API_KEY— For ClaudeBETTER_AUTH_SECRET— Authentication secret
Docker Compose (all-in-one)
For a fully containerized setup (app + worker + WS server + DB + Redis + MinIO), save the file below asdocker-compose.selfhost.yml in bap/app, then run:
http://localhost:3000.
docker-compose.selfhost.yml
BYOC daemon (local compute)
The BYOC daemon is meant to run on the user’s local machine, not inside the server Docker stack. This lets the server execute tools and sandbox commands on their device.- Install the daemon using the provided scripts in
src/daemon/scripts/. - Authenticate the device:
- Start the daemon:
- Set
E2B_API_KEYandE2B_TEMPLATEto use E2B cloud sandboxes. - Or set
DAYTONA_API_KEY(plus optionalDAYTONA_SERVER_URL/DAYTONA_TARGET) to use Daytona sandboxes.
Background worker
Bap uses BullMQ for background jobs (e.g., processing integrations). Start the worker in a separate terminal:WebSocket server (BYOC)
The WebSocket server handles daemon connections and runs separately from Next.js:Useful commands
| Command | Description |
|---|---|
bun dev | Start the dev server |
bun build | Production build |
bun worker | Start the background job worker |
bun ws:dev | Start the BYOC WebSocket server |
bun db:push | Push schema changes to the database |
bun db:studio | Open Drizzle Studio (database browser) |
bun db:seed | Seed the database |
bun lint:fix | Fix linting issues |
bun typecheck | Run the TypeScript type checker |
bun test | Run unit tests |
bun test:e2e | Run end-to-end tests |
Tech stack
| Layer | Technology |
|---|---|
| Web | Next.js 16, React 19, Tailwind CSS 4 |
| API | ORPC, Better Auth |
| Database | PostgreSQL, Drizzle ORM |
| AI | Anthropic Claude, OpenAI, Google Gemini |
| Queue | BullMQ, Redis |
| Storage | S3 / MinIO |
| Sandbox | E2B, Daytona |
