Skip to main content

Quickstart

Install Anvil, scan your project, and fix your first issue -- all in under 5 minutes.

Prerequisites

  • Node.js 20.0.0 or later
  • pnpm, npm, or yarn
  • A TypeScript or JavaScript project

Install

Closed beta

Anvil is currently in closed beta. You need to request access before you can install.

# Using pnpm (recommended)
pnpm add -D @eddacraft/anvil-cli

# Using npm
npm install -D @eddacraft/anvil-cli

Initialise

Run the setup wizard in your project root:

anvil init

Anvil detects your project type, creates an .anvilrc configuration file, and sets up the .anvil/ directory:

Initialising Anvil in current project...

Detected environment:
Project: my-app
Package Manager: pnpm
Git: yes
TypeScript: yes

Anvil initialised successfully!

Created files:
.anvilrc
.anvil/

Scan Your Project

This is the moment you see what Anvil catches. Run a full scan:

anvil check --all

Most projects have something. Here is typical output:

Checking architecture... done
Checking anti-patterns...
[AP-003] Explicit any type detected
src/utils/parser.ts:42
Using 'any' defeats type safety
Fix: Define a proper type or use 'unknown'

[AP-006] Empty catch block
src/services/auth.ts:87
Empty catch blocks hide errors
Fix: Log the error or re-throw

2 warnings found.

If everything passes, you will see:

Checking architecture... done
Checking anti-patterns... done
Checking secrets... done

All gates passed.

Turn On Watch Mode

Start Anvil in the background so it validates on every save:

anvil watch --source
Anvil Watch

Watching for changes...
Press Ctrl+C to stop.

Save a file and see Anvil catch it. Every change is validated in milliseconds, not minutes.

Run watch mode in a dedicated terminal pane or use the VS Code extension

for in-editor diagnostics. :::

Fix Your First Issue

Take one of the warnings from the scan -- say AP-003, the explicit any in src/utils/parser.ts:

Before:

export function parse(input: any): Record<string, unknown> {
// ...
}

After:

export function parse(input: string): Record<string, unknown> {
// ...
}

Save the file. If watch mode is running you will see immediate confirmation:

Change detected: src/utils/parser.ts

Checking anti-patterns... done

All gates passed.

One warning down. Repeat for the rest at your own pace.

Next Steps

Feature tutorials:


Need help? Check Troubleshooting or open an issue.