Skip to content

cwp inventory

shipped 1.0.0
cwp inventory [flags]

cwp inventory groups the commands below and takes no action of its own; run it alone and it prints its help.

FlagWhat it doesDefault
--with-agentwith —dry-run on a host with no shell: install and remove the PHP agent so the plan is realoff
SubcommandWhat it does
cwp inventory snapshotWrite inventory.yml from what is installed (read-only against the site)
cwp inventory applyInstall, activate and update to match inventory.yml

What it does

cwp inventory keeps the record of what a working copy of this site runs on: the WordPress version, the locale, the plugins and the themes. With it a fresh clone is not an empty docroot.

snapshot writes inventory.yml from what the site has installed. apply installs what is missing and activates or deactivates to match. “Reproducible” means the same plugins on, not merely present.

Three things are deliberately absent from the file:

  • anything under tracked: you deploy your site plugin rather than install it, and listing it would invite apply to fetch a wordpress.org plugin sharing the slug;
  • must-use plugins, two of which cwp generates itself;
  • drop-ins, which hosting puts in place.

Two fields on an entry are yours to write, and a snapshot only carries them forward: source: for an item that is not on wordpress.org, and environments: for one that belongs on some environments and not others. See apply for what each does.

Omitting the environment means the local site.

What it does not do

It fetches no premium plugins, stores no licence keys and updates nothing. A source: is a URL the file records, not a licence cwp holds.

It is not cwp fetch. fetch copies the plugin files down so a fresh checkout renders; inventory records and reproduces which plugins you want installed and active. One is transport, the other is intent.