Black Friday Sale is Live: Get up to 30% OFF RankReady Pro - the WordPress AI SEO pluginBlack Friday Sale is Live: Up to 30% OFF Get Deal
Reference

Hatch WP-CLI Commands

Reference for the wp hatch WP-CLI commands: setup, diagnose, info, revalidate and env, with options and examples for headless WordPress on Cloudflare.

Last updated October 29, 2026

By the end of this page you will know every wp hatch command, what it does and which options it takes. The commands load only when WP-CLI is running.

wp hatch setup

Runs the full WordPress-side setup: the preflight diagnostic, sets the revalidation webhook URL and prints a ready-to-paste .env block. Hatch does not create users or Application Passwords; the command prints the WordPress core command to create one for an existing low-privilege user.

  • --frontend=<url> URL of your frontend, used for the webhook.
  • --frontend-user=<login> the Subscriber account the frontend reads as. Defaults to the current user.
  • --name=<name> name for the suggested Application Password.
  • --skip-diagnose skip the preflight checks.
wp hatch setup --frontend=https://mysite.com --frontend-user=reader

wp hatch diagnose

Runs the preflight checks and prints the results. Use --format=table or --format=json.

wp hatch info

Prints detected plugins and site state. Accepts --format=table|json.

wp hatch revalidate

Fires the revalidation webhook by hand. Optional --reason=<reason> (default cli-manual). If no webhook is set, it stops with an error and tells you to run wp hatch setup --frontend=<url>.

wp hatch env

Prints the .env block: HATCH_WP_URL, WORDPRESS_USER, a WORDPRESS_APP_PASSWORD placeholder for you to fill in, and HATCH_WEBHOOK_SECRET. It needs a user, so run it as wp --user=<admin> hatch env. It does not create an Application Password.

Typical workflow

  1. Create a Subscriber user in WordPress.
  2. Run wp hatch setup with that user and your frontend URL.
  3. Run the printed command to make the Application Password and paste the .env block into your frontend.
  4. Run wp hatch diagnose to confirm everything passes.

What to do next