anvil CLI is the primary entry point for all Anvil development workflows. Once you install the package, the anvil command is available in your project’s node_modules/.bin and, when using a package manager with bin hoisting, on your PATH. Every workflow — scaffolding, local development, production builds, MCP serving, linting, evaluations, and trace replay — runs through this single binary.
Commands at a glance
| Command | What it does |
|---|---|
anvil init | Scaffold package.json, tsconfig, and starter routes for a new (or existing) project |
anvil dev | Start a live-reload development server with TypeScript route loading |
anvil build | Scan routes, emit .gen/routes.ts, and bundle dist/server.mjs |
anvil start | Run the production bundle produced by anvil build |
anvil mcp | Serve MCP-exposed routes and server/tools/ as an MCP tool server |
anvil lint | Validate route params and schemas; exits non-zero on errors |
anvil eval | Run a deterministic + LLM-judge eval suite against an agent route |
anvil replay | Re-run a captured agent trace with mocked model responses |
Explore each command
anvil init
Scaffold a new project — pick a basic API, MCP server, or agent route template.
anvil dev
Start the live-reload development server with file watching and instant route hot-reloading.
anvil build
Generate the route manifest and bundle a self-contained production server.
anvil start
Run the production bundle created by
anvil build, with optional port override.anvil mcp
Expose your routes as an MCP tool server over HTTP or stdio for AI agents and Claude Desktop.
anvil lint
Catch param mismatches and lossy MCP schemas at compile time, before a broken deploy.
anvil eval
Run deterministic and LLM-as-judge assertions against agent routes in a reproducible suite.
anvil replay
Replay a captured trace locally with no live model calls to debug production failures.
Installation
The CLI is included in the mainanvil package — no separate install is needed.
Anvil requires Node.js ≥ 20. All CLI commands are ESM-native and use the Node.js
--input-type=module environment automatically.