documentation

Sites

Create a WordPress site from nothing, attach any PHP directory you already have, or import a WordPress site from LocalWP or DDEV. Every site is a slug, a domain, a database and a PHP pool.

Create

agent-local create NAME [--domain d] [--php v] [--repo url]

# a WordPress 8.4 site on a custom domain
agent-local create mysite --domain mysite.example --php 8.4

# create from a fresh git repo, ready for a theme checkout
agent-local create mysite --repo git@github.com:me/mytheme.git

Downloads WordPress, provisions the database, writes wp-config.php, registers the hosts entry, issues and trusts the certificate, installs wp-cli caches. Prints the URL and admin credentials.

Attach

agent-local attach ~/Sites/existing --name existing

# a Laravel checkout: public/ is found and served
agent-local attach ~/Sites/shop --domain shop.test

Serves a directory that already exists. Your files are never touched, and the site gets its own domain, certificate and empty database. The app is detected from what is in the docroot and shown in the site record as its kind:

KindDetected byWhat attach does
WordPresswp-load.phpkeeps an existing wp-config.php; writes one only when core is there with none
Joomlaadministrator/ + configuration.phpprints the database credentials to paste into configuration.php
Laravelartisanserves public/; prints credentials for .env
Drupalcore/lib/Drupal.phpserves the docroot; prints credentials for settings.php
PHPan index.php, nothing else recognisedserves it front-controller style: real files first, then index.php
emptynothing yetregisters the site; re-detected the moment files arrive

The serving layer is the same for every kind. What differs is the toolkit: wp, wpdebug, wpconst, login, wp_info and the URL-pin checks in doctor are WordPress-only and say so for another kind rather than failing on a missing wp-config.php. checkpoint on a non-WordPress site saves the whole docroot rather than wp-content. The media fallback watches the app's own uploads path — /images/ for Joomla, /sites/default/files/ for Drupal.

create and import are WordPress-only. For another app, attach the directory and load its database with agent-local db SLUG import dump.sql — the WordPress URL rewrite is skipped for other kinds, so the dump lands as-is.

Lifecycle

CommandWhat it does
agent-local listevery site, its PHP version, state and URL
agent-local open SLUGthe site (or open admin SLUG — wp-admin)
agent-local start · stop · restart SLUGcontrol one site; starting a running site is a no-op
agent-local delete SLUG --yesremove it — a database snapshot is saved first; --keep-files / --keep-db opt out of either
agent-local resolve [PATH]which site owns a path (default: the working directory)

PHP versions

agent-local php SLUG 8.3        # live switch, pool restarted
agent-local install php 8.2     # or install a runtime by hand

Each site runs its own pool, so versions are per-site and switching is live. Installing a version agent-local does not have yet reaches Homebrew for it — including releases Homebrew has since dropped, via a versioned tap.

Deleting an imported site never touches files outside ~/.agent-local: in-place imports are detached and the original wp-config.php restored from the .bak.