Skip to content

fix(kit): a content CLI from a config shows and checks its write keys; WordPress keeps passwords out - #205

Merged
leemour merged 2 commits into
mainfrom
fix/kit-content-review
Nov 19, 2026
Merged

leemour merged 2 commits into
mainfrom
fix/kit-content-review

Conversation

@leemour

@leemour leemour commented Nov 19, 2026

Copy link
Copy Markdown
Member

Why

The two reviews of wordpress-cli 0.1.0 found gaps in what new --from-config writes, fixed by hand in that CLI. This moves the fixes into the kit, so the next content or WordPress CLI starts with them.

What

  • Content write keys (FIND-2820). For a content source with writes, src/config.ts passes cli-core's CONTENT_WRITE_KEYS, CONTENT_WRITE_DEFAULTS and contentAlsoChecks. Before, posts create --dry-run said allow for a write that asks, and --allow-delete did not name posts.delete.force.
  • Keys on the api path (WC-PERM-22). The api group's create and update of the written route (found from SOURCE.writes) also check posts.create and posts.update, so a deny on a posts command stops the raw write. The posts commands' preview names the api key their write also checks, delete included.
  • No application password (SEC-202). A wp-json CLI leaves out /wp/v2/users/{user_id}/application-passwords when the index has it: its POST answers a new password in clear, and the index marks no field secret.
  • WordPress writes that ask. Installing a plugin, settings, users, comments, templates, widgets, sidebars, menus and navigation default to ask, with or without a content source. Only the routes the index has are named.
  • Tests that check what they send. The content options test checks each write's result, the --dry-run keys, and that posts.create: deny stops the api write. The wp-json api test checks every option's value, a second page with --all, and every write that asks.
  • kit/README.md and a changes/ fragment.

Pages are not mapped to posts.* here, as the kit only knows the route source.writes names. wordpress-cli maps them by hand.

Testing

  • kit/e2e.sh WordPress case run locally: lint, generate, ci:quick, contracts:check, test:coverage, docs:check passed.
  • pnpm vitest run kit/test/from-config.test.ts kit/test/new.test.ts: 73 passed.
  • Reviewed by a fresh agent; its findings are fixed in the second commit (the delete preview, the service name, the SAMPLE comment, the tests). The same delete fix goes to wordpress-cli in fix(permissions): posts delete --dry-run names api.posts-delete wordpress-cli#2.

🤖 Generated with Claude Code

leemour and others added 2 commits November 19, 2026 11:19
…; WordPress keeps passwords out

Ports the review fixes of wordpress-cli 0.1.0 into what new --from-config writes:

- src/config.ts of a content CLI with writes passes cli-core's content write keys, their ask levels
  and their extra checks, so --dry-run shows what a write checks (FIND-2820). The api group's create
  and update of the written route, found from SOURCE.writes, check posts.create and posts.update too,
  and the posts commands name the api key their write also checks (WC-PERM-22).
- A wp-json CLI leaves out the application-passwords route, whose POST answers a new password in
  clear (SEC-202), and its plugin, settings, user, comment, template, widget, menu and navigation
  writes ask by default.
- The content options test checks each write's result and the deny on the api path; the wp-json
  api test checks every option's value, a second page with --all, and the writes that ask.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- posts delete's preview names the api key of the written route's delete too: with posts.delete set
  to allow the run still asked through it.
- The service name is passed in, not read back; the SAMPLE comment stays above API.
- Tests: --dry-run of posts create and posts delete --allow-delete names each key it checks; every
  WordPress write that asks is tested, a permission that also needs a publish key included; the
  non-content WordPress config keeps its site-wide asks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour merged commit 23266c0 into main Nov 19, 2026
16 checks passed
@leemour
leemour deleted the fix/kit-content-review branch November 19, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant