Formic β AI-powered task manager that turns goals into shipped code. Orchestrates Claude Code, Copilot CLI, and OpenCode with structured planning, parallel execution, and human review. π
formic-demo.mp4
πΊ Watch the demo video if the player above doesn't load.
AI coding agents are powerful but chaotic. Without structure, they skip planning, overwrite each other's files, and lose context mid-task. Formic adds a tech-lead layer β every task goes through briefing, planning, and review before code ships.
- ποΈ Structured pipeline β Brief β Plan β Declare β Execute β Review
- π Parallel execution β multiple agents work simultaneously with file-lease concurrency
- π― Goal decomposition β describe a high-level objective, the architect AI breaks it into subtasks
- π‘οΈ Crash-resilient β atomic saves, rolling backups, auto-recovery from corruption
- π₯οΈ 100% local β your code never leaves your machine
- Node.js 20+ and npm
- A supported AI agent CLI:
- Claude Code CLI β
npm install -g @anthropic-ai/claude-code - GitHub Copilot CLI β
gh extension install github/gh-copilot - OpenCode CLI β
npm install -g opencode-ai
- Claude Code CLI β
-
Install β
npm install -g @rickywo/formic -
Start the server β Run
PORT=8000 formic start, then open http://localhost:8000. -
Add a workspace β Open the workspace selector in the top-left and point it at your project repo directory.
Formic supports three AI agent backends. Switch between them from the Kanban header via the provider dropdown β no server restart needed. The dropdown shows which CLIs are installed and their versions.
| Agent | AGENT_TYPE |
Auth |
|---|---|---|
| Claude Code CLI | claude (default) |
ANTHROPIC_API_KEY env var |
| GitHub Copilot CLI | copilot |
gh auth login (GitHub OAuth) |
| OpenCode CLI | opencode |
opencode auth login or provider key |
Precedence: UI selection > AGENT_TYPE env var > claude (default). The env var acts as a headless/startup fallback.
OpenCode notes:
- Install:
npm install -g opencode-ai - Auth:
opencode auth login(supports Anthropic, OpenAI, and other providers) - Set
OPENCODE_DISABLE_AUTOUPDATE=1in your.envfor headless/CI stability β οΈ Formic runs opencode with--auto(auto-approves permissions). Only run on trusted, isolated workspaces.
Choose a model for each workflow stage and the chat assistant in Settings β Agent Models.
Selections are stored separately for each agent type.
Agent default uses the CLI's own default model.
For OpenCode, enter model IDs in provider/model format.
By default, Formic binds to 127.0.0.1 (loopback only) and requires no authentication for local use. Breaking change: if you need to expose the server on your network (e.g. HOST=0.0.0.0), you must also set FORMIC_AUTH_TOKEN to a shared secret:
HOST=0.0.0.0 FORMIC_AUTH_TOKEN=your-secret-token formic start
Without a token, starting on a non-loopback host will exit immediately with an error β the API (POST /api/tasks, POST /api/tools) can execute arbitrary code in your workspace, so it must never be reachable without authentication. When a token is configured, every HTTP request and WebSocket connection must set the Authorization header to Bearer, followed by a space and the token value, or the server responds with 401 Unauthorized.
Recommended for remote access: rather than exposing the port directly, use an SSH tunnel (e.g. ssh -L 8000:localhost:8000 user@host) and keep the server bound to loopback.
Formic exposes an API that executes arbitrary code in your workspace by design β treat it as a security-critical service. Follow these guidelines when deploying beyond your local machine.
Two purpose-built images are published to Docker Hub (docker.io/rickywo/formic):
| Tag | Purpose | Base | User |
|---|---|---|---|
0.9.1 (default / latest) |
Headless runtime | node:22-slim (digest-pinned) |
node (non-root) |
0.9.1-devcontainer |
Interactive development shell | node:22-bookworm (digest-pinned) |
developer (non-root) |
Both images:
- Run as non-root β no sudoers entries of any kind
- Install agent CLIs from npm with exact version pins β no
curl \| bashpipelines - Never embed secrets at build time β all credentials are runtime-only env vars
- Default to
127.0.0.1binding β a baredocker runcannot accidentally expose an unauthenticated API
docker run -d \
-p 8000:8000 \
-e ANTHROPIC_API_KEY=sk-ant-... \
-e HOST=0.0.0.0 \
-e FORMIC_AUTH_TOKEN=your-strong-secret \
-v /path/to/your/project:/app/workspace \
docker.io/rickywo/formic:0.9.1HOST=0.0.0.0 requires FORMIC_AUTH_TOKEN β the server will refuse to start otherwise.
docker run -it --rm \
-v /path/to/your/project:/workspace \
docker.io/rickywo/formic:0.9.1-devcontainerThis drops you into a zsh shell with the Formic CLI and all agent CLIs pre-installed. It is not intended for headless deployment.
The included docker-compose.yml references the published image and applies additional hardening:
read_only: trueroot filesystem (tmpfs on/tmp)no-new-privileges:truesecurity optionFORMIC_AUTH_TOKENenforced via${FORMIC_AUTH_TOKEN:?...}β Compose will refuse to start without it
export ANTHROPIC_API_KEY=sk-ant-...
export FORMIC_AUTH_TOKEN=$(openssl rand -hex 32)
export WORKSPACE_PATH=/path/to/your/project
docker compose up -dIf you use Telegram messaging, set a webhook secret to authenticate incoming updates:
export TELEGRAM_BOT_TOKEN=your-bot-token
export TELEGRAM_WEBHOOK_SECRET=$(openssl rand -hex 32)When configured, the Telegram webhook endpoint (POST /api/webhooks/telegram) requires the X-Telegram-Bot-Api-Secret-Token header to match. If not set, Formic generates and persists a random secret automatically. See .env.example for all options.
These environment variables are never embedded in the image β always pass them at container runtime:
ANTHROPIC_API_KEYβ Claude Code agentFORMIC_AUTH_TOKENβ API authentication (required forHOST=0.0.0.0)TELEGRAM_BOT_TOKEN/TELEGRAM_WEBHOOK_SECRETβ Telegram messagingLINE_CHANNEL_ACCESS_TOKEN/LINE_CHANNEL_SECRETβ LINE messagingOPENAI_API_KEY/DEEPSEEK_API_KEYβ OpenCode with other providers
If you use Formic to develop Formic itself (workspace = the Formic repo), do not run the server under tsx watch / npm run dev while executing tasks that modify files under src/server/**. The agent's edits trigger a watch-mode restart, which recovers and re-dispatches the task on boot, creating an infinite dispatch loop. Symptoms include:
- The same task cycles through queued β briefing β running repeatedly in rapid succession
- Multiple orphaned agent CLI processes editing files concurrently
- Agent logs show repeated
queued β briefingtransitions with no precedingrunning β queued
Instead, build first and run the production server:
npm run build && npm startOr use a separate checkout of the Formic repo as your workspace, leaving your development checkout untouched by agent edits. Formic detects self-hosting at startup and prints a warning.
- Brainstorm β Chat with the AI Assistant to refine your idea and explore the codebase.
- Create a Goal β The assistant crafts a structured task with clear requirements.
- Automatic decomposition β The architect AI breaks the goal into 3β8 child subtasks.
- Parallel execution β Agents execute tasks concurrently with file-lease safety (briefing β planning β declaring β running β verifying).
- Review & approve β When tasks land in the Review column, inspect the changes and approve. Your feature is ready.
- π‘οΈ Crash-resilient board β atomic saves with rolling backups and auto-recovery
- β‘ Smart stage skipping β detects existing artifacts and resumes where it left off
- π Usage meter β track agent credit consumption in real-time
- π Resume from any step β re-run tasks without restarting from scratch
- πͺ΅ Full log replay β reconnect and see complete task history
