AClaw # AClaw **Your personal agent command center. Local, packaged, one command.** [![npm](https://img.shields.io/badge/npm-aclaw-F5883B?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/aclaw) [![version](https://img.shields.io/badge/version-1.0.0-F5883B?style=flat-square)](CHANGELOG.md) [![node](https://img.shields.io/badge/node-%E2%89%A5%2020.19-2DE1DC?style=flat-square&logo=nodedotjs&logoColor=white)](https://nodejs.org) [![typescript](https://img.shields.io/badge/TypeScript-strict-2DE1DC?style=flat-square&logo=typescript&logoColor=white)](tsconfig.json) [![docker](https://img.shields.io/badge/Docker-required-2DE1DC?style=flat-square&logo=docker&logoColor=white)](https://www.docker.com/products/docker-desktop/) [![license](https://img.shields.io/badge/license-MIT-64748B?style=flat-square)](#license) ```bash npm install -g aclaw && aclaw ```
--- AClaw runs an OpenAI-backed agent **on your machine**. No hosted backend, no dashboard to log into, no data leaving your laptop except the model calls you make yourself. You get a CLI, a local web control surface, a WebSocket orchestrator, persistent sessions, a Docker-backed sandbox the agent actually executes in, and a live view of everything it does — tool by tool, iteration by iteration. ```text ___ ________ / | / ____/ /___ __ __ / /| | / / / / __ `/ | /| / / / ___ | / /___/ / /_/ /| |/ |/ / /_/ |_| \____/_/\__,_/ |__/|__/ ``` ## Why AClaw | | | |---|---| | 🐾 **One command** | `aclaw` opens an interactive menu. No config file to write first. | | 🖥️ **Local web UI** | Full control surface at `127.0.0.1:22529`, served by the same process. | | 🔍 **Nothing hidden** | Live run events, tool traces, todos, plans, context stats, snapshots. | | 📦 **Real sandbox** | Agent code and commands run in a persistent Docker workspace, not in your shell. | | 🌐 **Real browser** | Playwright tool with a warm browser and a live screencast streamed into the UI. | | 💾 **Persistent** | Sessions survive restarts. Queue a message mid-run and it gets injected cleanly. | | 🧠 **Skills** | Install skills from the CLI, mention them in a prompt, they land in the run context. | ## Architecture ```mermaid flowchart LR CLI["aclaw CLI"] -->|spawn| SRV UI["Web UI
127.0.0.1:22529"] <-->|WebSocket| SRV TTY["Terminal client"] <-->|WebSocket| SRV SRV["Orchestrator"] --> AGENT["Agent loop
context budget · compaction"] AGENT --> TOOLS["Tool registry"] TOOLS --> DOCKER["Docker workspace"] TOOLS --> PW["Playwright browser"] TOOLS --> HTTP["HTTP · Wikipedia · todos"] SRV --> STORE[".aclaw/sessions"] ``` The default port is `22529` — `ACLAW` on a phone keypad. ## Requirements - Node.js 20.19 or newer - Docker Desktop, installed **and running** - an OpenAI API key > [!IMPORTANT] > Docker is not optional. The agent's file and command execution lives in a persistent container, > and `aclaw run` refuses to start without a healthy daemon. For development only, bypass it with > `ACLAW_SKIP_DOCKER_CHECK=1`. ## Install ```bash npm install -g aclaw ``` Then: ```bash aclaw ``` > [!TIP] > Running `aclaw` with no arguments opens the interactive terminal menu. In a non-interactive > environment it prints help instead. ## 60 Seconds To First Run ```bash npm install -g aclaw # 1. install aclaw run # 2. start (prompts for your API key if unset) open http://127.0.0.1:22529/ # 3. create your local account, start talking ``` `aclaw run` preflights the Docker CLI, the Docker daemon and your OpenAI configuration, then starts the local server and serves the UI. If `OPENAI_API_KEY` is missing it walks you through setup and can write it to a local `.env`. > [!WARNING] > The account you create is local to your machine, stored in `.aclaw/auth.json`. There is no > recovery flow — delete the file to reset it. ## CLI | Command | What it does | |---|---| | `aclaw` | Interactive menu: Run · Status · Stop · Setup · Update · Help · Quit | | `aclaw run` | Preflight Docker + OpenAI, start the server in the background, serve the UI | | `aclaw status` | Server state, browser URL, WebSocket URL, PID, log path | | `aclaw stop` | Stop the background server | | `aclaw setup` | OpenAI setup flow, optionally writing to `.env` | | `aclaw update` | `npm install -g aclaw@latest` | > [!NOTE] > Developing with `npm link`? Use `npm run build` instead of `aclaw update`. ## Web App ```text http://127.0.0.1:22529/ ``` - create the first local account, then log in with username and password - open or create sessions - send messages, or queue them while a run is active - watch live run events as they stream - review tool calls, todos, plans and snapshots in the inspector drawers - clear or delete sessions - install and remove skills - shut down the local server > [!TIP] > In packaged mode the web app and the WebSocket server share one port — nothing else to launch. ## Sessions A session is a persistent conversation. The default session is: ```text main ``` Sessions are stored at: ```text .aclaw/sessions/.json ``` When you send a message while a run is already active, AClaw queues it and injects it at the next agent iteration boundary. ## Skills Installed skills are stored locally: ```text .aclaw/skills/ ``` Recommended layout: ```text owner/skill/SKILL.md ``` From the terminal client, install skills with: ```text /learn @owner/skill /learn skillset:name ``` Then mention skills in prompts to make AClaw inject them into the run context. ## Terminal Client The browser UI is the main packaged experience. AClaw also includes a terminal client for direct chat. Start the server first: ```bash aclaw run ``` Then, from the repository checkout: ```bash npm run cli:client ``` Useful variables: ```bash ACLAW_USERNAME="alice" \ ACLAW_PASSWORD="..." \ ACLAW_SESSION="main" \ npm run cli:client ``` Terminal client commands: - `clear`: clear the current session - `exit` or `quit`: close the terminal client - `/context` or `/ctx`: show context statistics - `/copy`: copy conversation and debug output - `/cpit`: copy detailed output with tools, iterations, and internal notes - `/auto status`: show auto-resume status - `/auto on [seconds]`: enable auto-resume - `/auto off`: disable auto-resume - `/auto run`: request an automatic resume - `/learn @owner/skill`: install a skill - `/learn skillset:name`: install a skillset - `/learn list`: list installed skills - `/learn remove owner/skill`: remove a skill Autocomplete works with `Tab`. ## Local Files AClaw stores local runtime state under: ```text .aclaw/auth.json .aclaw/server.json .aclaw/server.log .aclaw/sessions/ .aclaw/skills/ ``` The persistent Docker workspace uses: ```text Volume/ ``` > [!IMPORTANT] > These files are local runtime state. Do not commit them. ## Configuration Main environment variables: - `OPENAI_API_KEY`: required OpenAI API key - `OPENAI_MODEL`: optional model override, default `gpt-5.4` - `ACLAW_WS_HOST`: server host, default `127.0.0.1` - `ACLAW_WS_PORT`: server port, default `22529` - `ACLAW_WS_URL`: WebSocket URL for the terminal client, default `ws://127.0.0.1:22529` - `ACLAW_SESSION`: terminal client session, default `main` - `ACLAW_USERNAME`: optional terminal client username - `ACLAW_PASSWORD`: optional terminal client password - `ACLAW_MAX_ITERATIONS`: max iterations per run, default `50` - `ACLAW_CONTEXT_TOKEN_BUDGET`: max agent context budget, default `200000` - `ACLAW_RECOVERY_CONTEXT_TOKEN_BUDGET`: forced recovery context budget after error, default `3500` - `ACLAW_SKIP_DOCKER_CHECK`: set to `1` to bypass Docker preflight checks - `ACLAW_DOCKER_DNS`: optional DNS servers for the Docker sandbox - `ACLAW_DOCKER_PYTHON_IMAGE`: default Docker image for the workspace - `ACLAW_DOCKER_CONTAINER_NAME`: persistent Docker container name - `ACLAW_DOCKER_WORKSPACE_PATH`: host path for the Docker workspace - `ACLAW_DOCKER_FULL_ACCESS`: set to `1` to give the workspace container a writable root filesystem and run it as root; this permits system package management inside the container ## Troubleshooting ### Docker Is Not Running Check Docker: ```bash docker --version docker info ``` Start Docker Desktop, then run: ```bash aclaw run ``` For development-only testing without Docker: ```bash ACLAW_SKIP_DOCKER_CHECK=1 aclaw run ``` ### Port Already In Use Use another port: ```bash ACLAW_WS_PORT=22530 aclaw run ``` Then open: ```text http://127.0.0.1:22530/ ``` ### Server Looks Stuck Check status: ```bash aclaw status ``` Watch logs: ```bash tail -f .aclaw/server.log ``` Restart: ```bash aclaw stop aclaw run ``` ### Reset Local Account Stop AClaw: ```bash aclaw stop ``` Remove local auth state: ```bash rm .aclaw/auth.json ``` Open the web app again and create a new local account. ## Local Development > [!NOTE] > This section is for contributors working from a repository checkout. Most users should install the npm package instead. Install dependencies: ```bash npm install ``` Build: ```bash npm run build ``` Link the local package globally: ```bash npm link ``` Run the linked command: ```bash aclaw ``` After code changes, rebuild: ```bash npm run build ``` ### Development Scripts ```bash npm run orchestrator npm run ui:dev npm run cli:client ``` Vite development UI: ```text http://127.0.0.1:5173/ ``` Production UI build output: ```text dist-web/ ``` Scripts: - `npm run build`: type-check Node, type-check web, build Vite, chmod the binary - `npm run orchestrator`: start only the TypeScript orchestrator - `npm run ui:dev`: start the Vite web UI - `npm run ui:build`: build only the web UI - `npm run cli:client`: start the terminal client ### Testing A Package Tarball Locally ```bash npm run build npm pack npm install -g ./aclaw-1.0.0.tgz aclaw ``` Uninstall: ```bash npm uninstall -g aclaw ``` ## License MIT — see [LICENSE](LICENSE).


AClaw — local by default.