GET STARTED

Quickstart

Install AnySwarm, prepare local OpenSandbox containers, run your first multi-agent task, and inspect the result in Trace Viewer.

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 docker CLI via Homebrew is not enough — the Linux daemon must be running. Verify the active context with docker context show and docker 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 the docker group (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 run anyswarm update to print the upgrade command). If npm reports EACCES, install into a user-writable prefix such as npm install -g --prefix "$HOME/.local" @anyswarm/core@latest and add $HOME/.local/bin to your PATH.

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.md and 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.ts before starting a multi-peer run.

Next steps