Skip to content

cwp plugins apply

shipped 1.0.0
cwp plugins apply [env] [flags]

Acts on the local site unless an environment is named.

ArgumentWhat it isDefault
[env]environment to change (omit for the local site)
FlagWhat it doesDefault
--prunealso delete plugins and themes plugins.yml does not listoff
--exactinstall the recorded version over a different oneoff
--forceoverride the protected-environment refusaloff
--no-backupskip the remote backup taken before the writeon
--yesskip the confirmation promptoff

Plus the shared flags --json, --verbose and --dry-run.

What it does

Installs what plugins.yml lists and is missing, then activates and deactivates to match it.

cwp does not know where a plugin came from, and says so. wp plugin list has no field distinguishing a wordpress.org plugin from a premium one — on a real install Bricks and your own site plugin both report update: none. So apply tries, then names exactly what it could not get:

! apply — 4 applied, 1 failed
! 1 item(s) could not be installed from wordpress.org — install them yourself:
  bricks 2.4 — bricks: Plugin not found.

That is not a failure. A premium plugin is a normal thing to have; this is the list of what to do by hand.

Additive by default. A plugin present but unlisted is left alone. --prune deletes it, and the confirmation names every one it would remove. A version difference is reported, not silently corrected — --exact installs the recorded version over what is there.

Against a remote this is an upward write with the full guard set: installing or deactivating a plugin changes what a live site does.

Example

cwp plugins apply              # make this machine match plugins.yml
cwp plugins apply --dry-run    # what would change
cwp plugins apply prod --force # bring a protected environment into line

What it does not do

It fetches no premium plugins and stores no licence keys.

It never writes upward to plugins.yml — the file is the source, and snapshot is the only command that writes it.

It updates nothing. A plugin that is installed and active at the recorded version is left exactly as it is.