Browse all docs

Anvil Cloud / Getting started

Quickstart

Use this flow to create an Anvil Cell and inspect its output before deployment.

Anvil Cloud is v0 and the packages are currently private inside the anvil-cloud workspace. The stable command contract is anvil ...; from a local checkout you can run the CLI package directly while packaging settles.

1) Prepare the checkout

From anvil-cloud:

pnpm install --ignore-scripts
pnpm build

If dependencies are already installed, pnpm build is enough to refresh the package output used by the CLI.

2) Create a Cell

With a linked or installed anvil binary:

anvil new notes
cd notes

From the workspace during v0 development:

node packages/cli/dist/index.js new notes
cd notes

The scaffold creates:

notes/
  AGENTS.md
  anvil.json
  package.json
  tsconfig.json
  src/
    cell.server.ts
    cell.client.tsx

The generated server defines a todos table, a listTodos query, an addTodo mutation, and capabilities.database.

3) Check before build

anvil check --json

In local workspace development, when the Cell lives directly under the repo root:

node ../packages/cli/dist/index.js check --json

check validates:

  • Cell config
  • import policy
  • direct process.env access
  • undeclared global fetch
  • scheduled jobs without capabilities.scheduledJobs
  • handler capability use
  • TypeScript typecheck
  • manifest extraction readiness

Fix check failures before trying to run or deploy.

4) Build artifacts

anvil build --json

The builder writes:

.anvil/
  dist/
    client/
      index.html
      assets/
    server/
      index.mjs
    manifest.json
    build-meta.json
  generated/
    api.d.ts
    client.ts

The manifest is the key handoff to local runtime and deployment adapters.

5) Run locally

anvil dev

Default local URLs:

Surface URL
Runtime http://localhost:8787
Client http://localhost:5173

Useful local routes:

GET  /_anvil/health
GET  /_anvil/manifest
GET  /_anvil/inspect
POST /_anvil/query/:name
POST /_anvil/mutation/:name
ANY  /api/*

For automation:

anvil dev --json
anvil dev --agent --json

Agent mode emits JSONL events and avoids spinners, terminal control codes, and unstable prose.

6) Inspect local state

anvil inspect --local --json
anvil logs --local --json
anvil db list --local --json
anvil db dump todos --local --json

Local state is stored under .anvil/local:

.anvil/local/
  auth.json
  dev.db
  events.json
  files/
  jobs.json
  logs.ndjson

7) Preview deployment

anvil deploy --preview --json

Without AWS provisioning configuration, the preview adapter returns a stable deployment plan, CloudFormation template, and deploy artifact summary rather than mutating an AWS account.

To provision preview infrastructure, configure the AWS adapter environment described in AWS preview.

Read next