📖 Complete documentation for WP-CLI https://make.wordpress.org/cli/handbook/
Find a file
github-actions[bot] c75a8769de
Some checks failed
Code Quality Checks / code-quality (push) Waiting to run
Regenerate Manifest / Regenerate manifest (push) Failing after 0s
Update handbook manifest (#648)
2026-06-09 14:41:12 +02:00
.github Add workflow to regenerate the workflow manifest (#647) 2026-06-09 14:35:27 +02:00
behat-steps Regenerate handbook 2025-12-17 18:56:32 +00:00
bin Update handbook manifest (#648) 2026-06-09 14:41:12 +02:00
commands Some minor tweaks 2026-01-20 17:27:47 +01:00
contributions Add WP-CLI support page (#645) 2026-06-09 11:33:36 +02:00
guides Add WP-CLI support page (#645) 2026-06-09 11:33:36 +02:00
how-to Update plugin unit tests support link (#642) 2026-06-02 10:45:06 +02:00
internal-api Regenerate 2025-12-17 21:53:06 +01:00
references Document guidelines for use of exit codes within commands (#632) 2026-03-20 00:03:05 +01:00
.gitattributes Add .gitattributes file 2026-03-16 16:17:30 +01:00
.gitignore Fix scaffold package 2024-08-01 16:24:32 +05:45
.typos.toml spellcheck fixes 2026-01-26 22:55:41 -05:00
behat-steps.md Regenerate handbook 2025-12-17 18:56:32 +00:00
composer.json Fix indentation 2025-12-17 19:47:29 +01:00
contributions.md Introduce a Security Vulnerability Reporting page (#646) 2026-06-09 10:40:23 +02:00
guides.md Merge branch 'main' into copilot/add-documentation-version-constraints 2026-01-20 17:23:29 +01:00
how-to.md Add how-to guide: Figure out why WordPress is slow 2026-01-12 12:51:06 +00:00
index.md Add WP-CLI support page (#645) 2026-06-09 11:33:36 +02:00
internal-api.md Regenerate handbook 2025-12-17 18:56:32 +00:00
LICENSE Update copyright date 2022-01-07 12:55:32 -06:00
phpcs.xml.dist Update PHPCS repo links 2026-06-09 11:31:01 +02:00
phpstan.neon.dist Fix PHPStan config 2026-03-12 10:38:24 +01:00
README.md Update README.md 2025-12-28 12:16:34 +01:00
references.md Document guidelines for use of exit codes within commands (#632) 2026-03-20 00:03:05 +01:00
support.md Add WP-CLI support page (#645) 2026-06-09 11:33:36 +02:00
wp-cli.yml Clean up command implementation 2025-12-17 17:38:07 +01:00

wp-cli/handbook

These files comprise the WP-CLI handbook (make.wordpress.org/cli/handbook) and WP-CLI commands directory (developer.wordpress.org/cli/commands).

The documentation is located in GitHub to enable a pull request-based editing workflow.

Long-form documentation (e.g. "Commands cookbook") can be edited directly.

Internal API docs and command pages are generated dynamically from the WP-CLI codebase using the wp handbook series of commands.

Before running these commands, the bash script bin/install_packages.sh should be run to install the latest versions of the non-bundled commands in bin/packages. Note that wp must point to the target WP-CLI instance (i.e., the phar or git version that contains the docblocks to be generated against) and should be run with WP_CLI_PACKAGES_DIR=bin/packages and WP_CLI_CONFIG_PATH=/dev/null.

So for instance to generate all dynamically created documentation against the nightly phar run:

wp cli update --nightly
bin/install_packages.sh
WP_CLI_PACKAGES_DIR=bin/packages WP_CLI_CONFIG_PATH=/dev/null wp handbook gen-all

Automated Handbook Generation

The handbook can be regenerated automatically using the "Regenerate Handbook" GitHub Actions workflow. This workflow can be triggered in two ways:

  1. Manual trigger: Navigate to the Actions tab in the GitHub repository and run the "Regenerate Handbook" workflow manually.
  2. Automated trigger from wp-cli/wp-cli: When a new version of WP-CLI is released, the main framework repository can trigger this workflow using a repository_dispatch event with type regenerate-handbook.

The workflow will:

  • Install WP-CLI nightly build
  • Install non-bundled packages
  • Run wp handbook gen-all
  • Commit and push any changes to the repository

Documentation Import

All documentation is imported automatically into WordPress.org in a two step process:

  1. WordPress reads commands-manifest.json or handbook-manifest.json to understand all pages that need to be created.
  2. Each WordPress page has a markdown_source attribute specifying a Markdown file to be fetched, converted to HTML, and saved in the database.

For make.wordpress.org/cli, the import process is a WordPress plugin running a WP Cron job every 15 minutes. For developer.wordpress.org/cli, this is a class in the devhub theme running a WP Cron job every 12 hours.