Using Claude Code, Codex, or Cursor? Give your coding agent the dedicated pure-Markdown setup runbook:
Read https://anyswarm.github.io/anyswarm/setup.md and guide me through setting up @anyswarm/core@latest on this machine.It probes your environment first, asks your approval before installing system dependencies (such as Docker Desktop or Node), and asks before starting any paid model run.
AnySwarm ships its CLI and TypeScript SDK in one package (@anyswarm/core) and runs Agents inside OpenSandbox containers on your machine using Docker.
Prerequisites
| Dependency | Requirement | Verify |
|---|---|---|
| OS | Linux or macOS (Apple Silicon / Intel) | uname -sm |
| Node.js & npm | Node.js >= 22.19 (Node 24 LTS recommended) |
node --version && npm --version |
| Git | Required for workspace capture and examples | git --version |
| Docker | Running local Linux container engine | docker info |
| Executor backend | At least one of Pi or Codex installed on the host | which pi || which codex |
Docker setup notes
- macOS: Install and start Docker Desktop for Mac (or OrbStack). Installing only the
dockerCLI via Homebrew is not enough — the Linux daemon must be running. Verify the active context withdocker context showanddocker info --format '{{.OSType}}/{{.Architecture}}'. - Linux: Install Docker Engine (
sudo apt-get update && sudo apt-get install -y docker.io git ca-certificates && sudo systemctl enable --now docker.service). If the Docker socket denies access, add your user to thedockergroup (sudo usermod -aG docker "$USER") and sign in again.
1. Install AnySwarm and an Executor
Install the AnySwarm CLI globally:
npm install -g @anyswarm/core@latest
anyswarm --version
If you do not yet have an in-sandbox executor backend, install Pi (lightweight default, supports both Responses and Chat Completions) or Codex (requires a Responses endpoint):
# Option A: Pi (recommended default)
npm install -g @earendil-works/pi-coding-agent
# Option B: Codex
npm install -g @openai/codex
To update later, run
npm install -g @anyswarm/core@latest(or runanyswarm updateto print the upgrade command). If npm reportsEACCES, install into a user-writable prefix such asnpm install -g --prefix "$HOME/.local" @anyswarm/core@latestand add$HOME/.local/binto yourPATH.
2. Initialize OpenSandbox and verify locally
Run anyswarm setup on the machine where containers will run:
anyswarm setup
If both Pi and Codex are installed, pass --backend pi or --backend codex to skip the interactive choice.
anyswarm setup detects your OS, Node.js, and Docker daemon, prepares the local OpenSandbox service (default 127.0.0.1:8080), builds the matching Worker image, and runs a controlled smoke test verifying Worker, Service Bridge, Model Gateway, file export, and container cleanup.
You can re-run the free verification check at any time without spending model tokens:
anyswarm doctor --smoke
Expect "ok": true and "infrastructure": "ready". To connect to a remote OpenSandbox or Kubernetes cluster instead of local Docker, see Sandboxes.
3. Run your first multi-agent task
Set your model endpoint and API key (credentials stay on the host inside Host Gateway and are never injected into containers):
export ANYSWARM_MODEL_URL='https://api.openai.com/v1/responses'
export ANYSWARM_MODEL_ID='gpt-5-mini'
export ANYSWARM_MODEL_TOKEN='<your-api-key>'
Clone a small repository, eject the built-in subagents Harness, and run a parallel engineering handoff across isolated child sandboxes:
git clone https://github.com/sindresorhus/p-limit.git ./handoff-input
anyswarm eject subagents --dir ./handoff
(
cd ./handoff
npm install
npm start -- --config ./handoff-config.ts --cwd ../handoff-input \
--prompt 'Prepare an engineering handoff for this repository. Assign two different children: ask one to find its public entry points, exported types and how to run repository checks, and ask the other to identify scheduling flow, core state and test coverage. Have both return concrete findings with file paths and line numbers. Cross-check their citations and write report.md without modifying source files.' \
--output-dir ../runs
)
The host captures a snapshot of ./handoff-input, gives each Agent a private sandbox copy, and exports report.md under ./runs without touching your original directory. Once it works, swap --cwd to any directory in your own repository.
4. Inspect the Run in Trace Viewer
anyswarm trace --root ./runs --port 8787
Open the printed URL (http://127.0.0.1:8787). If you are running on a remote Linux server, forward the port over SSH:
ssh -N -L 8787:127.0.0.1:8787 user@your-host
In the browser, verify three things separately:
- Timeline: Root spawned two children, their inspection overlapped in parallel, and findings flowed back through the collaboration Service.
- Files & Results: Open the exported
report.mdand verify cited file paths and line ranges. - Lifecycle status: Check business outcome, artifact export, and container cleanup independently.
5. Optional advanced demo: try AutoResearch locally
Once the basic handoff works, you can test AnySwarm’s flagship autonomous research loop on a local directory with an ordinary LLM and a lightweight Python evaluator script (no heavy benchmark images required):
anyswarm eject autoresearch --dir ./research-local
cd ./research-local
npm install
Point config.ts at a local target folder and a deterministic scoring script (eval.py), set your peer count, time window (e.g., 10–15 minutes), and evaluation budget, then inspect every candidate patch, peer review, and host score in anyswarm trace --root ./runs.
Note: Running live demos calls your configured model API. Always review the budget and timeout settings in
config.tsbefore starting a multi-peer run.
Next steps
- Core Concepts — Understand the six building blocks behind every Harness.
- Build your first SDK Harness — Write a minimal two-agent Harness directly in TypeScript.
- AutoResearch Walkthrough — See how all six SDK building blocks connect in an end-to-end research system.