Skip to main content
The 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

CommandWhat it does
anvil initScaffold package.json, tsconfig, and starter routes for a new (or existing) project
anvil devStart a live-reload development server with TypeScript route loading
anvil buildScan routes, emit .gen/routes.ts, and bundle dist/server.mjs
anvil startRun the production bundle produced by anvil build
anvil mcpServe MCP-exposed routes and server/tools/ as an MCP tool server
anvil lintValidate route params and schemas; exits non-zero on errors
anvil evalRun a deterministic + LLM-judge eval suite against an agent route
anvil replayRe-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 main anvil package — no separate install is needed.
npm install anvil
Run any command via your package manager’s script runner:
npx anvil dev
# or add to package.json scripts:
# "dev": "anvil dev"
Anvil requires Node.js ≥ 20. All CLI commands are ESM-native and use the Node.js --input-type=module environment automatically.