CLI
Lumbermill ships with a set of WP-CLI commands under the wp instance namespace.
They are provided by the instance-cli mu-plugin and are only available when WP-CLI is active.
activate
Section titled “activate”One-time setup commands that enable an opt-in feature, scaffold a starter class, and update the relevant config file.
activate ajax
Section titled “activate ajax”wp instance activate ajax- Creates
app/Ajax/Action/ExampleAjaxAction.php - Sets
enabled => trueinconfig/ajax.php
See Advanced → AJAX for the full guide.
activate rest-api
Section titled “activate rest-api”wp instance activate rest-api- Creates
app/RestAPI/ExampleRestAPI.php - Sets
enabled => trueinconfig/rest-api.php
See Advanced → REST API for the full guide.
Scaffold classes and wire them up automatically.
All make commands accept a --confirm=true flag to skip the preview confirmation prompt.
make ajax
Section titled “make ajax”wp instance make ajax <name>Generates an AJAX action class in app/Ajax/Action/. The AjaxAction suffix is added automatically.
wp instance make ajax GetPosts# → app/Ajax/Action/GetPostsAjaxAction.phpmake rest-api
Section titled “make rest-api”wp instance make rest-api <name>Generates a REST API endpoint class in app/RestAPI/. The RestAPI suffix is added automatically.
wp instance make rest-api Cats# → app/RestAPI/CatsRestAPI.phpmake hook
Section titled “make hook”wp instance make hook <name>wp instance make hook <name> --register=trueGenerates a hook class in app/Hook/. With --register=true (or confirming the prompt) it also adds the class to config/hooks.php.
wp instance make hook ThemeColours --register=true# → app/Hook/ThemeColoursHook.php# → added to config/hooks.phpmake provider
Section titled “make provider”wp instance make provider <name>Generates a provider class in app/Provider/ and a matching config file in config/. Also registers the provider in functions.php via $config->addProvider().
wp instance make provider ThemeOptions# → app/Provider/ThemeOptionsProvider.php# → config/theme-options.php# → $config->addProvider(new \App\Provider\ThemeOptionsProvider) added to functions.phpmake classmap-post
Section titled “make classmap-post”wp instance make classmap-postwp instance make classmap-post --post-type=<slug>Generates a Timber post classmap class in app/Classmap/Post/ and registers it. Prompts for a post type if --post-type is omitted.
make classmap-term
Section titled “make classmap-term”wp instance make classmap-termwp instance make classmap-term --taxonomy=<slug>Generates a Timber term classmap class in app/Classmap/Term/ and registers it. Prompts for a taxonomy if --taxonomy is omitted.
make classmap-menu
Section titled “make classmap-menu”wp instance make classmap-menuwp instance make classmap-menu --menu=<slug>Generates a Timber menu classmap class in app/Classmap/Menu/ and registers it.
make classmap-menu-item
Section titled “make classmap-menu-item”wp instance make classmap-menu-itemwp instance make classmap-menu-item --menu=<slug>Generates a Timber menu item classmap class in app/Classmap/MenuItem/ and registers it.
make util
Section titled “make util”wp instance make util <name>Generates a utility class in app/Util/. The Util suffix is added automatically.
wp instance make util String# → app/Util/StringUtil.phpmake template
Section titled “make template”wp instance make template <name>Generates a WordPress page template: a PHP controller file and a matching Twig view. Use kebab-case for the name.
wp instance make template my-page# → templates/my-page.php# → views/templates/my-page.twigThe PHP file includes the Template name: comment that WordPress uses to expose the template in the page editor. The Twig file extends layouts/base.twig and includes a content block ready to fill in.
make field-group
Section titled “make field-group”wp instance make field-groupInteractive command that scaffolds an ACF field group for any content type. Prompts for:
- Location type — all 22 ACF location rules (Post Type, Page Template, Taxonomy, etc.)
- Location value — dynamic select list for supported types (post types, taxonomies, templates, page types, user roles, nav menus, options pages, etc.), or free-text input for the rest
- Field group name — kebab-case name for the group (e.g.
content,meta)
New content type folder — creates the folder, index.php (with location rule), and the field group file. No wiring needed: acf-php/index.php autoloads every nested index.php via a glob, so the new folder is picked up automatically:
acf-php/post-types/post/├── index.php ← location rule + register call└── content.php ← createFieldGroup('Post - Content')->addField(...)Existing content type folder — creates only the field group file and appends the load + register lines to the existing index.php.
Field group title is automatically prefixed with the location label, e.g. Post - Content, Front Page - Hero.
wp seed fills the site with example content, so templates can be built and reviewed against realistic data. Seeding and purging refuse to run in production.
seed auto
Section titled “seed auto”wp seed auto # list targets and their fieldswp seed auto post page --count=5 # seed 5 posts and 5 pageswp seed auto page:templates/contact.php # pages using a page templatewp seed auto post --generate-images # placeholder images instead of the media libraryFills the target’s ACF fields based on their type: text, links, images, relations, repeaters, flexible content and so on. Fields of a type it doesn’t know are left empty and listed after the run. Images are picked from the media library unless --generate-images is passed.
Each run is a batch, so it can be removed again:
wp seed batches # list batcheswp seed purge --batch=<batch> # remove one batchwp seed purge # remove everything seededPurging deletes the posts, terms and images the seeder created, nothing else.
Project specific values
Section titled “Project specific values”Some fields need a valid value rather than random content, e.g. an ID that links to another post. Filter them in a seeder file in web/app/mu-plugins/instance-seed/seeders/, which is loaded automatically:
<?php
add_filter('instance_seed/field_value', static function (mixed $value, array $field, array $context): mixed { return match ([$context['post_type'], $field['name']]) { ['event', 'event_details_capacity'] => 120, default => $value, };}, 10, 3);
add_action('instance_seed/seeded_post', static function (int $postId, string $postType): void { // runs after each seeded post}, 10, 2);A custom seeder can also register its own command, e.g. wp seed news, with WP_CLI::add_command() in the same folder.

