Skip to content

cwp settings push

shipped 1.0.0
cwp settings push [env] [flags]

This name is an alias. The work moved to cwp push --only settings, and that page documents it. This spelling still runs for one minor cycle.

Acts on the local site. Name an environment to act there instead.

tree → site

ArgumentWhat it isDefault
[env]environment to write (default: default_environment in cwp.yml)
FlagWhat it doesDefault
--forceoverride the protected-environment refusaloff
--no-backupskip the remote backup taken before the writeon
--yesskip the confirmation promptoff
--with-agentwith —dry-run on a host with no shell: install and remove the PHP agent so the plan is realoff

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

What it does

Writes the options in settings/ onto a site. This is an individually-named upward write. The plan lists every key that would change before the write. The protected environment refusal applies. cwp takes a remote backup first unless you waive it.

A key the site already holds at that value stays as it is, and the plan says so.

A path the group holds on the target (hold: in cwp.yml) comes from the site before the compare and goes back with the option. The tree says everything but the licence key. The target says the licence key. update_option gets the two together. A held path that differs on its own is not a change. A path classify: marks as environment, secret, log or derived gets the same treatment. A path marked attachment, post or term holds an identity in the tree. The push resolves it to the target’s id before the compare. One the target cannot resolve keeps the target’s value, and the plan names it:

  ex_seo_settings.category → category/gone: not on dev. Field left as it is

Additive, like the inventory

An option the site holds that no group describes is reported and left alone. This tool does not delete site configuration because a committed file is silent. Usually the silence means nobody has added the key to the allowlist yet. The report is where you find that out.

References resolve on the target

A post-reference option carries a page’s identity rather than its ID. The push resolves it against the environment it is writing to. A page the target does not have is a failure that names the key. The push never writes a zero into page_on_front. A zero there would silently turn the front page into the blog listing and look deliberate afterwards.

What it does not do

  • It does not delete options.
  • It does not push what it was not given. A group whose file has never been pulled is a refusal naming the pull, not an empty write.
  • It does not touch the database directly. Every write goes through WordPress’s own option API.