arraydev / wpkit
CLI support for WP Tool Kit.
Requires
- arraydev/wptoolkit: v1.1.14-beta
- symfony/console: ^7.0
- symfony/yaml: ^6.4
This package is auto-updated.
Last update: 2026-07-09 09:52:13 UTC
README
wpkit is a CLI toolkit for creating WordPress plugins that use arraydev/wptoolkit.
It scaffolds plugin structure, Composer metadata, PHPUnit tests, build settings, and common WordPress runtime classes such as REST routes, admin pages, meta boxes, custom post types, hooks, shortcodes, widgets, and AJAX handlers.
Command Overview
Run the current command list:
php wpkit list
Project command groups:
plugin:*: create plugins from interactive answers or JSON config.make:*androute:create: generate runtime classes inside an existing plugin.language:*,locale:*, andtranslation:*: manage PHP translation dictionaries forWpToolKit\Manager\LocaleManager.project:build: build production artifacts from.buildignoreand.build.json.toolkit:namespace-update: rewriteWpToolKitnamespace references.lint:check: run recursive PHP syntax checks.ai:*: local workspace helpers for status, diff, search, file IO, checks, and indexing.
Available project commands:
| Group | Commands |
|---|---|
| Plugin creation | plugin:create, plugin:create-from-file, plugin:init-config |
| Scaffolds | make:route, make:param, make:action, make:ajax, make:cron, make:filter, make:admin-page, make:page, make:metabox, make:post, make:shortcode, make:widget, make:wpbakery-element, make:wpbakery, route:create |
| Translations | language:add, language:remove / language:delete, locale:add / translation:add, locale:update / translation:update, locale:remove / locale:delete / translation:remove / translation:delete, locale:show / translation:show |
| Build | project:build |
| Toolkit maintenance | toolkit:namespace-update |
| Linting | lint:check |
| AI helpers | ai:status, ai:diff, ai:find, ai:read, ai:write, ai:check, ai:index-build, ai:index-update, ai:index-show, ai:index-remove |
See Command Reference for every command, argument, option, and alias.
Quick Start
Create a plugin interactively:
php wpkit plugin:create
Create a plugin from JSON:
php wpkit plugin:init-config php wpkit plugin:create-from-file plugin-config.json
Create a plugin with demo scaffolds:
php wpkit plugin:create --demo php wpkit plugin:create-from-file plugin-config.json --demo
Or set "demo": true in plugin-config.json.
Generated Plugin
A new plugin includes:
- main plugin file with WordPress headers
src/Boot.phpandsrc/Main.php- Composer PSR-4 autoloading
- PHPUnit setup with
tests/ExampleTest.php .buildignore.build.json- default folders for admin, hooks, REST, post types, shortcodes, services, widgets, views, config, assets, and translations
Translation Commands
wpkit can manage PHP-file dictionaries used by WpToolKit\Manager\LocaleManager.
php wpkit language:add en php wpkit language:remove en php wpkit locale:add en payment.maib_payment "Payment via MAIB" php wpkit locale:update en payment.maib_payment "MAIB payment" php wpkit locale:remove en payment.maib_payment php wpkit locale:show payment.maib_payment
The default base directory is languages. Use --base=resources/lang for a custom translation root.
Use --dictionary=request.entity.passenger when the address is only a key inside a nested dictionary.
When demo mode is enabled, wpkit also generates example classes for:
- custom post type
- meta box
- admin page
- REST route
- REST param
- AJAX handler
- action hook
- shortcode
- widget
- view mapping and view file
Build
Run:
php wpkit project:build
Build behavior is configured by .build.json.
The full pipeline can:
- Copy project files into
build/<plugin>while respecting.buildignore. - Always copy
composer.jsonandcomposer.lock. - Never copy the source
vendorfolder. - Run Composer install with dev dependencies.
- Run tests.
- Stop the build when tests fail.
- Replace dev vendor with production
composer install --no-dev. - Keep, remove, or scope vendor into
vendor_scoped. - Create a ZIP archive.
- Optionally remove the unzipped build folder.
See Build for the full config reference.
Documentation
For AI assistants, start with AI Context, then load only the skill file that matches the task from docs/ai-skills/.