Start a local project with an AI agent

Vibe coding with WordPress on your own computer: put the zip of Leitvia Pro in an empty folder, paste one prompt into Claude Code or Codex, and the AI agent sets up a local WordPress with @wordpress/env, the theme, Studio, Pro, the skills and the MCP connection.

For developers and agencies · any Pro plan · Checked with Leitvia 1.2.69, Leitvia Studio 1.3.65, Leitvia Pro 0.8.55 and @wordpress/env 12.2.0

Before you start

  • Node.js 20 or later, git and unzip.
  • Docker Desktop or another Docker engine, started.
  • Claude Code or Codex CLI, signed in.
  • An empty folder with the zip of Leitvia Pro in it. You find it in your account on leitvia.com, page Overview, section Download.
  • The license key from your account, page License and sites. You paste it yourself at the end.
The section Download on the page Overview of the Leitvia account: the link Download Leitvia Pro with the version and the hint to upload the zip under Plugins and enter the license key.
The zip of Leitvia Pro is on the page Overview of your account.
The page License and sites of the Leitvia account: the section License key and the table of the sites that use it.
The license key and every site that uses it, on the page License and sites.

The prompt

Open a terminal in the folder, start claude or codex and paste the prompt. The same text works for both; the agent decides by itself where its skills go. The first start downloads WordPress and the Docker images and takes a few minutes.

Set up a local WordPress project for Leitvia Pro in this folder with @wordpress/env, so that you can build the site afterwards with the theme Leitvia, the plugin Leitvia Studio, Leitvia Pro and the Leitvia skills. Do the steps in order. If a step fails, stop and tell me what failed and what I can do.

1. Check that Node.js 20 or later, npm, git, unzip and Docker are installed and that Docker is running. Check that this folder holds the zip of Leitvia Pro from my account at leitvia.com (leitvia-pro*.zip). If something is missing, list it and stop.
2. Unzip the Pro zip here so that ./leitvia-pro/leitvia-pro.php exists.
3. Write .wp-env.json with exactly this content. If port 8888 or 8889 is taken, put two free ports into "port" and "testsPort" and use that address below instead of localhost:8888:
{
  "core": null,
  "phpVersion": "8.2",
  "port": 8888,
  "testsPort": 8889,
  "themes": [ "https://downloads.wordpress.org/theme/leitvia.zip" ],
  "plugins": [ "https://downloads.wordpress.org/plugin/leitvia-studio.zip", "./leitvia-pro" ],
  "config": { "WP_ENVIRONMENT_TYPE": "local", "WP_DEBUG": true, "WP_DEBUG_LOG": true }
}
4. Run "npx -y @wordpress/env start", then "npx -y @wordpress/env run cli wp theme activate leitvia" and "npx -y @wordpress/env run cli wp rewrite structure /%postname%/". In Git Bash on Windows set MSYS_NO_PATHCONV=1 for these commands, or it rewrites the paths.
5. Create the agent user with the role of Leitvia Studio: "npx -y @wordpress/env run cli wp user create leitvia-agent agent@example.org --role=leitvia_agent", then "npx -y @wordpress/env run cli wp user application-password create leitvia-agent local-agent --porcelain". Write LEITVIA_AUTH=<Base64 of leitvia-agent:password> and LEITVIA_AUTH_HEADER="Basic <LEITVIA_AUTH>" into .env. Never print the password in the chat.
6. Install the skills into this project: "git clone --depth 1 https://github.com/cmsadmins/leitvia-skills.git .leitvia-skills". If you are Claude Code, copy the folders skills, handbook and workflows of the clone into .claude/, otherwise into .agents/. Copy every folder of ./leitvia-pro/skills/ into the same skills folder. Then delete .leitvia-skills.
7. Connect the MCP server of Leitvia Studio at http://localhost:8888/wp-json/leitvia-studio/v1/mcp with the header "Authorization: Basic <LEITVIA_AUTH>".
   Claude Code: "claude mcp add --transport http --scope local leitvia http://localhost:8888/wp-json/leitvia-studio/v1/mcp --header "Authorization: Basic <LEITVIA_AUTH>"".
   Codex: add [mcp_servers.leitvia] with url = the address and env_http_headers = { "Authorization" = "LEITVIA_AUTH_HEADER" } to ~/.codex/config.toml, never the password itself. If that server name exists already, use leitvia-<name of this folder>.
8. Test the connection: send a JSON-RPC "initialize" and then "tools/list" with curl to the address and header from step 7. The answer must list tools. If it is a 401, check the password; otherwise stop with the answer of the server.
9. Write AGENTS.md: the site is http://localhost:8888 (login admin, password password, local only), the skills, handbook and workflows lie in the folder from step 6, work only through the abilities of the MCP server leitvia, use existing patterns and blocks before your own markup, and start a longer task with a workflow such as workflows/new-site.md. If you are Claude Code, also write CLAUDE.md with the single line @AGENTS.md.
10. Write .gitignore with .env, leitvia-pro*.zip, leitvia-pro/ and .claude/settings.local.json, and run "git init" if this is no git repository yet.
11. Tell me in a few lines: the address of the site and of wp-admin, which files you wrote, that I paste my license key under Leitvia Studio › Pro and choose Save and check, and that I start a new session in this folder so that the MCP server leitvia is loaded. If you are Codex, tell me to load .env first with: set -a; . ./.env; set +a

What the agent sets up

File or folderPurpose
.wp-env.jsonWordPress with PHP 8.2 at http://localhost:8888, the theme and Studio from WordPress.org, Pro from the folder leitvia-pro.
.envThe application password of the user leitvia-agent as Base64, once alone and once as header for Codex. Stays out of git.
.claude/ or .agents/Skills, handbook and workflows of Leitvia Skills plus the skills that come with Pro.
MCP server leitviaFor Claude Code in the local settings of this folder, for Codex in ~/.codex/config.toml with the name of the variable instead of the password.
AGENTS.mdThe rules for the next session: site address, skills, abilities first, patterns before custom markup.

The user leitvia-agent has the role Leitvia Agent. What an AI agent may do alone is set for the whole site under Leitvia Studio › Agents, tab Autonomy and checks; what it may not publish waits in the Inbox.

Activate Pro

Sign in at http://localhost:8888/wp-admin with admin and password, open Leitvia Studio › Pro, paste the key and choose Save and check. The agent does not do this step, because the key belongs to your team. The domain localhost takes one place of your plan like any other site. Save an empty field before you delete the project, and the place is free again.

The tab License under Leitvia Studio, Pro: the status of the license, the field for the license key with the button Save and check, and what the plan includes.
Leitvia Studio, Pro, tab License: paste the key and choose Save and check.

The first task

Start a new session in the folder, so that the agent loads the MCP server and reads AGENTS.md. A first read shows whether everything is in place:

Call leitvia/get-contract and leitvia/get-site-health on the MCP server leitvia and tell me the versions of the theme, Studio and Pro. Then follow workflows/new-site.md for http://localhost:8888, mode package.

In our check the agent named all three versions, found the Pro abilities and chose the skill leitvia-page for a home page.

Every day

TaskCommand
Start Codex with the passwordset -a; . ./.env; set +a; codex
Start or stop the sitenpx @wordpress/env start, npx @wordpress/env stop
Run WP-CLInpx @wordpress/env run cli wp …
Update theme and Studionpx @wordpress/env start --update loads the current versions from WordPress.org
Update ProDashboard › Updates in the local site, with an active key
Update the skillsRun step 6 of the prompt again
Remove everythingnpx @wordpress/env destroy, after you freed the license

Messages

You seeCause and fix
Cannot connect to the Docker daemonDocker is not running. Start Docker Desktop and paste the prompt again.
A timeout during wp-env startThe download of an image broke off. Running the command a second time is usually enough.
Port 8888 is already in useAnother site runs on it. The prompt picks two free ports, one for the site and one for the test instance of @wordpress/env; use the address the agent names.
401 from the MCP serverThe application password does not match. Let the agent create a new one with step 5.
The agent does not know the server leitviaThe session started before the setup. Start a new one in the same folder.

Data protection

The site runs only on your computer. The setup loads WordPress, the theme and Studio from WordPress.org and the skills from GitHub; Pro sends the key and the domain to leitvia.com once a day. WP_ENVIRONMENT_TYPE local allows application passwords without HTTPS, so never copy this .wp-env.json to a public server. What your agent sends to its provider is set in Claude Code or Codex, not in Leitvia.