حول
The coding agent that gets there first. Native macOS, 5x faster and 12x cheaper than opencode on the same model. Works with almost any model.
أدوات التطويرالنمو المقاس للنجوم
- خلال 24 ساعة
- +١
- خلال 7 أيام
- +٧
- خلال 15 يومًا
- جارٍ جمع السجل
- خلال شهر
- جارٍ جمع السجل
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلAnvil
The coding agent that gets there first.
5x faster and 12x cheaper than opencode on the same model.1 A native Mac app that reads, edits, runs and tests until the job is done, with every diff yours to review.
Features · Install · Quick start · Providers · How it works · Evals · Contributing

Anvil is a native Mac coding agent in the spirit of Claude Code and Codex, built with SwiftUI. Describe a change and it explores the repo, edits, runs your tests and fixes what breaks, while you watch diffs instead of waiting on a spinner.
Built to be fast
Same task, same model (GLM 5.3 Flash):
| Anvil | opencode | |
|---|---|---|
| Time to finish | 3 min | 15 min |
| Cost | $0.14 | $1.70 |
That gap comes from the protocol. Most agents call tools one at a time through the model's native tool-calling API. Anvil's agent speaks a plain-text protocol instead.
- Fewer round trips. The model batches several actions in one reply, such as reading three files or making two edits and running the tests, and read-only actions run in parallel. Fewer turns means less waiting.
- Less token overhead. There are no JSON tool schemas to resend on every request, so each call is smaller and cheaper.
- Cheap, fast models just work. Because it doesn't need native tool calling, it runs on any chat model, including small fast ones. Anvil adds its own checks to keep them on track: tests run before "done", a reviewer reads the diff, and a different model takes over after repeated failures.
1. One task, one run each, on the same model and machine. Results vary with the task and the model.
Why Anvil
- Bring your own model. Any OpenAI-compatible API in one JSON file, community provider plugins installed from a GitHub link, plus your own ChatGPT and Gemini web accounts. No vendor lock-in and no native tool calling required.
- Review everything. Every edit is a diff before it's written, every request is a checkpoint you can undo, and four permission modes decide what asks first.
- Built for the whole loop. A real terminal, a live browser preview the agent can drive, an iOS Simulator it can tap through, git, GitHub and language servers, all in one window.
- Parallel when it pays. Split a feature into sub-sessions that each run in their own git worktree, then merge them back with conflict checks.
Features
The agent
|
Review and safety
|
Accuracy
|
Speed
|
Built-in tools
|
Integrations
|
Install
There are no signed release builds yet (roadmap), so build from source.
Requirements: macOS 15 or later, Xcode 26 or later, XcodeGen (brew install xcodegen).
git clone https://github.com/heurica-labs/anvil.git
cd anvil
xcodegen generate
xcodebuild -project Anvil.xcodeproj -scheme Anvil -derivedDataPath build build \
CODE_SIGN_IDENTITY=- DEVELOPMENT_TEAM=
open build/Build/Products/Debug/Anvil.app
The CODE_SIGN_IDENTITY=- override signs the app ad hoc, so you don't need the maintainer's signing team. To sign with your own, set DEVELOPMENT_TEAM and CODE_SIGN_IDENTITY in project.yml instead.
Optional extras:
| For | Install |
|---|---|
| Simulator element tools | brew tap cameroncooke/axe && brew install axe |
| GitHub tools | brew install gh && gh auth login |
| Type checks | the language server for your stack: TypeScript (bundled with TypeScript 7, or typescript-language-server), pyright, gopls, rust-analyzer, sourcekit-lsp (ships with Xcode) |
The anvil CLI (macOS, Linux, Windows)
The same agent also runs in a terminal. Install the latest release:
curl -fsSL https://github.com/heurica-labs/anvil/releases/latest/download/install.sh | sh
On Windows (PowerShell):
irm https://github.com/heurica-labs/anvil/releases/latest/download/install.ps1 | iex
The scripts check the download against the release's SHA256SUMS and put anvil in /usr/local/bin or ~/.local/bin (on Windows, %LOCALAPPDATA%\Programs\anvil, added to your PATH). Builds: macOS universal, Linux x86_64 and arm64 (fully static, any distribution), Windows x86_64. The archives are also on the releases page.
To build it yourself instead, you need Swift 6.2 or later:
git clone https://github.com/heurica-labs/anvil.git
cd anvil
swift build -c release --product anvil
sudo install .build/release/anvil /usr/local/bin/anvil # or copy it anywhere on your PATH
On Windows the binary is .build\release\anvil.exe and needs the Swift runtime on PATH (the toolchain installer sets that up). If the build stops with STL1000: Unexpected compiler version, your Visual Studio is newer than Swift's clang: add -Xcc -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH -Xcxx -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH to swift build. On Linux it links libcurl and the Swift runtime dynamically.
Then sign in and start:
anvil auth rica # or: anvil config set api-key, anvil providers add openrouter
cd ~/code/myapp && anvil
Plain anvil opens an interactive session; anvil -p "…" runs one request and prints the answer. anvil --help lists everything. The CLI keeps its own settings and keys, separate from the app's.
Quick start
- Launch Anvil and open a project folder (⌘O).
- Open Settings → Provider (⌘,) and click Sign in to Rica…, or set up another provider (see Providers).
- Type what you want in the composer, for example "the date parser fails on ISO weeks, fix it and add a test", and press ⏎.
- Review diffs as they come, or switch the mode with ⇧⌘M.
Useful from there:
| Action | How |
|---|---|
| Undo the last task | ⌥⌘Z or /undo |
| Stop the agent | ⌘. or Esc |
| Queue a background task | ⌥⏎ or /queue <task> |
| Work on a separate branch | New worktree session |
| Commit with a generated message | /commit |
| Open a pull request | /pr |
| Attach files or git state | @file, @git-diff, @last-output |
Providers
Pick the model from the menu on the composer. Anvil talks to each provider directly; only Rica requests go through Heurica's servers.
Rica is the default for new installs. Sign in from Settings → Provider → Sign in to Rica… or with anvil auth rica: Anvil shows a code, you approve it at chat.heurica.dev, and the sign-in is tied to a key that never leaves the computer. Requests count against the Rica account's daily limit (anvil auth status shows how much is left). Rica lists and revokes your Anvil sign-ins in its settings. The API is described in docs/RICA-API.md.
| Provider | Models | Setup | Cost |
|---|---|---|---|
| Rica (default) | rica, Heurica's model |
sign in with a Rica account | free, within the account's daily limit |
| Experiential Labs | glm-5.3-flash-uncensored, glm-5.3-flash, deepseek-v4.1-flash and variants |
API key | priced per token |
| Any OpenAI-compatible endpoint ("Luna API") | whatever it lists at /v1/models |
URL | depends on the endpoint |
| ChatGPT (web) | chatgpt/auto, gpt-5.5, gpt-5.5-thinking, o3 and more |
sign in with your account | your ChatGPT plan |
| Gemini (web) | gemini-auto, gemini-pro, gemini-flash, gemini-flash-lite |
sign in with a Google account | free |
More providers, and writing your own
Settings → Provider → Add provider offers ready-made presets for Z.ai, OpenRouter, Groq, DeepSeek, Mistral, the OpenAI API, Ollama and LM Studio, and installs community plugins straight from a GitHub URL. Every provider is described by one anvil-provider.json file:
{
"spec": 1, "id": "zai", "name": "Z.ai", "type": "openai",
"baseURL": "https://api.z.ai/api/paas/v4",
"auth": { "type": "apiKey" },
"models": [{ "id": "glm-4.6", "context": 200000 }]
}
That's a complete provider for any OpenAI-compatible API. For services without one, such as a chat website, set "type": "process" and ship a small program in any language that speaks a JSON-lines protocol; Anvil can run the website sign-in for it and hand over the session. Before installing from GitHub, Anvil shows exactly which host a plugin talks to or which command it runs. The full spec, templates and a JSON Schema are in docs/PROVIDERS.md.
Keys and session cookies live in the macOS Keychain. Several ChatGPT or Gemini accounts can be added; requests start on the active one and fall through to the others when one is signed out or rate-limited.
[!WARNING] The ChatGPT and Gemini providers use the websites' own private endpoints, not official APIs. They can break whenever OpenAI or Google change their sites, and using them may go against those services' terms. Use them on accounts you're prepared to risk.
Signing in to ChatGPT and Gemini
Sign in to ChatGPT… / Sign in to Gemini… (in Settings, or from the model menu) opens the sign-in page and adds the account by itself as soon as you're in. Signing in again as the same person refreshes that account instead of duplicating it, and an account that stops working shows Sign in again.
Passkeys and Google's embedded-browser check don't work inside a web view, so the window has Use Safari: sign in there and Anvil reads the session from Safari's cookies, including one Safari already has. That needs Full Disk Access; the window asks for it when it's missing. Paste cookies… adds an account from another browser's Cookie header.
An expired session heals itself from Safari on the next request, but only when Safari is signed in as the same person.
How it works
flowchart LR
You([You]) -->|request| Agent
Agent -->|briefing + history| Model[(Any chat model)]
Model -->|reasoning + one JSON block| Parser[Lenient parser]
Parser -->|actions| Policy{Permission policy}
Policy -->|diff / command| You
Policy --> Tools[Files · Shell · Browser · Simulator · Git · GitHub · MCP]
Tools -->|observation| Agent
Agent -->|"done?"| Gate[Tests + review gate]
Gate -->|pass| Answer([Answer])
Gate -->|fail| Agent
Every reply is a sentence or two of reasoning followed by one fenced JSON block:
{"say": "Fixing the off-by-one in parseWeek.",
"actions": [{"tool": "replace_lines", "args": {"path": "src/date.ts", "start": 41, "end": 41, "content": " return week - 1"}},
{"tool": "shell", "args": {"command": "npm test"}}]}
Actions run in order and the batch stops at the first failure. Edit tools prepare their changes; the app computes diffs, applies the permission policy and records a checkpoint before anything is written. Results come back as one <observation>.
Protocol hardening learned from live runs
- First block wins. Stop sequences end a reply when the model starts writing its own observation, and only the first JSON block runs.
- String-aware repairs. The parser fixes trailing commas, comments, Python literals, raw newlines, missing braces and cut-off replies, without touching the contents of JSON strings.
- Useful parse errors. When a reply still can't be parsed, the model is shown where its JSON broke.
- No blind overwrites.
write_filerefuses to overwrite a file the agent hasn't read in this session. - Servers go to the background. Server commands sent to
shellare redirected tostart_process. - Re-anchoring. A model that claims it "can't access your files" is reminded that the app runs its actions.
- Tests stay honest. The prompt forbids weakening tests to make them pass.
Architecture
Anvil/
├── App/ entry point, app state, session controller, background queue, sub-sessions, headless runner
├── Brain/ agent loop, reply parser, prompt builder, model routing, provider clients
├── Providers/ provider spec, plugin registry and installer, plugin client, presets
├── Core/ permissions, diffs, checkpoints, git, LSP client, sessions, settings, keychain, web accounts
├── Tools/ file, shell, process, web, browser, simulator, GitHub and MCP tools
└── UI/ SwiftUI views: sidebar, conversation, composer, inspector, diffs, settings
AnvilTests/ parser, edit engine, permissions, git, LSP, and scripted agent runs against a fake model
evals/ realistic coding tasks with hidden checks, and the runner
examples/ provider plugin examples and templates
docs/ provider spec (PROVIDERS.md) and its JSON Schema
Headless mode
The same agent runs without a window, for scripts and evals. Sessions are saved and show up in the app afterwards. On any OS, the anvil CLI does the same with anvil -p "…" (--output json or stream-json for scripts; exit codes are listed in anvil --help). The app binary also takes --headless:
ANVIL_API_KEY=... build/Build/Products/Debug/Anvil.app/Contents/MacOS/Anvil --headless \
--project ~/code/myapp --prompt "Fix the failing test" --mode edits --approve
| Flag | Meaning |
|---|---|
--mode ask|edits|plan|bypass |
permission mode |
--approve |
answer permission prompts with yes, except dangerous commands |
--resume SESSION-ID |
continue a saved session |
--model ID, --max-steps N |
override the model and step limit |
--no-verify, --no-review, --no-escalate, --no-stream, --no-adaptive, --no-prefetch |
switch individual features off (for ablations) |
--parse FILE |
run the reply parser on a saved model reply |
Keys passed through the environment stay in memory and are never passed to the commands the agent runs.
Evals
evals/tasks/ holds 16 small, realistic tasks: bug fixes, features, refactors across files, implementing from a spec, a dev server, a performance fix, a flaky test, a shell script, and a question that must not change any files. Each has a setup.sh, a prompt.txt, and a hidden check.sh the agent never sees. Ten tb-* tasks are modelled on Terminal-Bench categories (recovering a secret from rewritten git history, a C/Python polyglot, fixing a broken C build, an XSS filter, an interactive installer, asyncio cancellation, SQL optimization, sysadmin config with TLS, a slow build, a 400k-row CSV transform) and ship a solution.sh; evals/validate.sh proves each check fails on the untouched project and passes with its solution. Every run happens in a fresh repo under /tmp, so evals never touch your sessions.
python3 evals/run.py --models glm-5.3-flash-uncensored,deepseek-v4.1-flash-uncensored --parallel 4
python3 evals/run.py --tasks py-,js-csv -- --no-review # arguments after -- go to the agent
Latest results (Bypass mode, effort high, 21 November 2026):
| Model | Pass | Avg steps | Avg time | Cost for all 16 |
|---|---|---|---|---|
| glm-5.3-flash-uncensored | 16/16 | 4.2 | 13.9 s | $0.018 |
| deepseek-v4.1-flash-uncensored | 16/16 | 4.6 | 14.3 s | $0.022 |
| glm-5.3-flash | 16/16 | 3.4 | 48 s | $0.031 |
| deepseek-v4.1-flash | 16/16 | 4.6 | 38 s | $0.067 |
| gpt-6-luna | 13/16 | 3.4 | 105 s | free |
The first two rows include the speed features (adaptive effort, prefetch, line-range edits, terse replies); turning off adaptive effort and prefetch alone took glm from 13.9 s to 17.6 s. The older rows predate those features. All three gpt-6-luna misses were provider errors (rate limits and challenges) before the agent started.
Configuration
| What | Where |
|---|---|
| Project memory | AGENTS.md, CLAUDE.md, .claude/CLAUDE.md or ANVIL.md in the project root |
| Custom commands | .anvil/commands/, .claude/commands/, ~/.claude/commands/ (markdown; $ARGUMENTS is replaced) |
| Skills | .anvil/skills/, .claude/skills/, ~/.claude/skills/ (SKILL.md folders) |
| MCP servers | the project's .mcp.json, or ~/Library/Application Support/Anvil/mcp.json |
| Provider plugins | Settings → Provider → Add provider; files in ~/Library/Application Support/Anvil/providers/ |
| Everything else | Settings (⌘,): Provider, Agent, Tools |
Roadmap
Next up: a bigger eval suite tracked over time, per-hunk review, shell checkpoints, persistent allow rules and hooks. See ROADMAP.md for the full list and known limitations.
Contributing
Issues and pull requests are welcome. See CONTRIBUTING.md for how to build, test and send a change. In short:
xcodegen generate
xcodebuild -project Anvil.xcodeproj -scheme Anvil -derivedDataPath build test \
CODE_SIGN_IDENTITY=- DEVELOPMENT_TEAM=
Tests marked Live talk to real services and skip themselves when they aren't set up.
To report a security problem, please follow SECURITY.md instead of opening a public issue.
Acknowledgements
Anvil grew out of Peep, an agentic desktop pet for macOS, whose text protocol and agent architecture it reuses. It also builds on:
- SwiftTerm for the terminal
- XcodeGen for the project file
- HanaokaYuzu/Gemini-API and zhaees/chatgpt-proxy, whose protocol work the web providers follow
- AXe for simulator accessibility
- elder-plinius/L1B3RT4S (AGPL-3.0), the source of the optional Jailbreak mode's prompts
License
Anvil is licensed under the GNU Affero General Public License v3.0. If you run a modified version for others over a network, you must offer them its source.
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…