Skip to main content
This page wires Avocado into a Next.js project of your own, using the packages published on npm. There is no repository to clone. Install them without pinning a version and let the registry resolve — the twelve packages ship in lockstep, so a mixed tree is the one thing worth avoiding. Nothing here is meant to be typed by hand. Paste the prompt below into the coding agent you already have open and let it do the wiring on a branch. The same work written out — as one shell block, or as seven steps with the reasoning attached — is on manual setup.

Just looking?

Try the demo instead: one command, a nine-page site, no API key and no repository. For deciding whether you want this.

Bringing a real site in?

This page wires a JSON-backed demo so you see the loop end to end in one sitting. Your site — real components, a real CMS — is a larger job: bring your site in.
If you would rather understand the model first, start with core concepts and how it works.

Prerequisites

  • Node.js 22+ — check with node --version
  • A coding agent — Claude Code, Codex, Cursor, or anything else with a terminal. If you have none, the shell block does the same work.
  • A Next.js 15 or 16 project on the App Router, or nothing at all — either path creates one if you point it at an empty directory.
  • One LLM API key — Anthropic, OpenAI, or Google Gemini. Avocado runs on your key and never resells tokens.
No database, no Docker, no auth setup for local development.
Using a Google Gemini key? Add @google/genai too. It is an optional peer dependency of @avocadostudio-ai/orchestrator-core, loaded lazily, so no package manager installs it for you and a Gemini plan fails at the first call without it. ANTHROPIC_API_KEY and OPENAI_API_KEY need nothing extra — both vendor SDKs are ordinary dependencies.

Hand this to your coding agent

Claude Code, Codex and Cursor already have a terminal in your project. Paste this and let one of them do the wiring, on a branch, as a diff you review. This is the demo prompt: a JSON file, two built-in blocks, one sitting. The prompt for bringing a real site in — your components, your CMS, your content — is a much longer job and lives at hand it to your coding agent.
The prompt is deliberately explicit about the two failures that are silent — the shadowing route in step 9 and the missing stylesheet in step 3. Both produce a working build and a wrong-looking site, so an agent that reasons from the result rather than from the instructions will report success either way.

Start both processes

Two terminals.
Serves your Next.js app on http://localhost:3000, with the orchestrator mounted inside it at /api/avocado.
The CLI’s default --orchestrator is http://localhost:4200, which is the standalone server’s address and wrong for library mode — pass the flag. On start it probes the orchestrator’s /health and warns if the reported protocol version does not match the editor build it ships. Every flag it takes: CLI and packages.
To make the site appear in the editor’s Sites list rather than relying on defaults, run npx avocado-register --name "My Site" --orchestrator http://localhost:3000/api/avocado from the project directory. It also generates a DRAFT_MODE_SECRET into .env.local if you do not have one — which you need in production, and do not need for local next dev.

Make your first edit

Open http://localhost:4100. Your page loads in the preview, with an empty chat composer beside it. Try one of these:
  • “Change the hero headline to ‘Cooking made delicious’”
  • “Add a testimonials section under the hero”
  • “Rewrite the CTA in a more playful tone”
What you should see:
  1. A streaming plan — the planner streams typed operations back, and each one appears in the chat as it is parsed.
  2. A live preview — operations apply to the real page in the iframe as they arrive.
  3. A change log — a readable summary of what changed and why.
  4. Undo — every plan is undoable from the chat history.
Destructive operations — removing a block, deleting a page — are held for explicit approval rather than applied and then undone. Nothing the chat can do touches a file in your repository. Every edit is one of a fixed set of typed operations against your content, validated against the block schemas before it is applied.
Clicking the preview does nothing until you turn the picker on. The cursor button in the composer toggles click-to-select, and it defaults to off so that links and carousels keep working while you read. A correct install looks inert until you press it. The rest of the interface: a tour of the editor.

Publish

Publishing is a separate, explicit step, and in library mode it goes through the adapter. The editor posts to the orchestrator’s /publish, the orchestrator takes the current draft for that session, and hands the pages to the adapter’s onPublish — which jsonFileAdapter only has when you asked for it:
writeOnPublish defaults to false because on most deployments it cannot work: Vercel, and every container built the ordinary way, give the running app a read-only filesystem. It is the right option for a file on your own machine and the wrong one everywhere else, so a deployed site publishes into something that persists — a CMS adapter, a database, or a commit back to the repository. The publish payload is diffed field by field against a baseline, so a target that writes diffs writes nothing for pages nobody touched. See publishing. Everything on this page publishes to your own machine, which is the one place that needs no credential. A deployment needs one, and there are two separate gates — the orchestrator’s, and the site’s publish route. Both are on security and access.

What’s next

You now have the loop running against a throwaway page. The real question is how your actual site gets in, and there are three honest paths.

Hand it to your coding agent

The path we recommend. Claude Code, Codex or Cursor already knows your codebase. Point it at these docs and let it work in your repo through your normal review flow.

Use the built-in onboarding agent

An agent inside the editor that migrates a public URL or integrates a repository. Early — treat its first pass as a draft. Needs the standalone orchestrator, so not the library-mode setup you just built.

Read the contract

Every seam the integration has to satisfy, whether a human or an agent writes it. This is the reference, not a tutorial.

Prove it worked

editableCoverage and panelCoverage grade the integration. The number is what tells you it is done.
Then the deeper rabbit holes:
  • Manual setup — the same wiring by hand, with the reasoning, plus troubleshooting
  • Custom blocks — register your own React components, which is what a real site edits.
  • Field table — one declaration that drives the schema, the panel, the CMS projection and the merge.
  • CMS adapters — Contentful, Sanity, Strapi, or your own.
  • MCP server — 49 tools over Model Context Protocol, for any MCP host.
  • Docker deployment — running the standalone orchestrator instead of library mode.

Troubleshooting

The full list — including every silent failure mode — is on manual setup. The three that catch most people: pnpm dev fails with a better-sqlite3 or sharp error. Your Next config is not wrapped in withAvocado. The preview shows the published page and never your edits. The editor is talking to a different orchestrator than the one inside your site. Confirm you passed --orchestrator http://localhost:3000/api/avocado. The chat answers, but nothing changes, and the model picker is empty. No provider key reached the orchestrator, or the dev server has not been restarted since you added one.