CLI Tools
Forme projects use three command line tools. Each has a distinct role — knowing which to reach for will save you time.
Forme Codegen
Forme codegen is a globally installed tool for scaffolding new projects and generating boilerplate. Install it once on your machine and use it across all your Forme projects.
Typical uses:
- Creating a new base, plugin or theme project (
forme new) - Generating boilerplate classes (
forme make) - Managing your local Docker environment (
forme ketch) - Bumping project versions and running tests (
forme bump,forme test)
See Installing Forme Codegen for setup instructions.
Wrangle
Wrangle is Forme's project-level command runner. Unlike forme codegen, it lives inside your project and is run from a base installation (or a plugin/theme with a test environment).
./tools/wrangle [command]It has two kinds of commands:
Built-in framework commands — these come with Forme and cover project-level tasks that don't belong in a globally installed tool. For example queue:run for running the next job in the job queue.
Custom commands — commands you write yourself for project-specific tasks. See Custom Commands for how to add your own.
Note: In plugin and theme projects, Wrangle requires a local WordPress test environment (
wp-test). This is a base installation configured within your plugin or theme project. See Tests for details.
WP-CLI
WP-CLI is the official WordPress command line tool and should be installed globally. Forme projects include a wp-cli.yml in the base installation so that it is correctly configured for the project structure.
Typical uses:
- Managing plugins and themes
- Inspecting and updating options (
wp option get siteurl) - Database operations (
wp db export,wp search-replace)
Which tool should I use?
| Task | Tool |
|---|---|
| Create a new project | forme codegen |
| Generate a class or boilerplate | forme codegen |
| Run the job queue | wrangle |
| Write a custom project command | wrangle |
| Manage WordPress (plugins, db, options) | wp-cli |
| Local Docker environment | forme codegen |