Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ More: [permissions](https://github.com/WireCatLabs/wordpress-cli/blob/main/docs/
- Only self-hosted WordPress with application passwords. WordPress.com sites, which sign in with OAuth, are not
supported. Sign-in through the browser is not there yet: you paste the password.
- An Author or Contributor gets only their own posts, and no pages: WordPress refuses the pages list to both, and the
sync says so. A Contributor gets only their drafts and posts waiting for review. For both, a post that leaves their
view stays in the copy as it was: one deleted for good, or a Contributor's post an editor published. Only an Administrator gets the users list. Sign in as an Administrator for a full
copy.
sync says so. A Contributor gets only their drafts and posts waiting for review. A post that leaves their view and
that they may no longer read stays in the copy as it was, such as a Contributor's post an editor published. Only an
Administrator gets every user with their e-mail; other roles get the authors with published posts. Sign in as an
Administrator for a full copy.
- No view counts. WordPress itself keeps none, and Jetpack stats are not supported.
- A post with galleries, columns, embeds or iframes keeps its body: `posts update` changes its title, excerpt, tags
and status only, unless you add `--replace-body`.
Expand Down
26 changes: 26 additions & 0 deletions changes/feat-pages-and-authors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
### Added

- **`posts create --type page` and every write to a page.** A page is now written through WordPress's pages routes:
create, update, publish, schedule, unpublish, trash and delete for good. A page has no tags, so `--tags` on a page
stops with `content.write-unsupported`. `--dry-run` names the pages keys a page write checks.

### Fixed

- **An Editor or Author gets the authors.** WordPress lists the users with their e-mail to an Administrator only, and
the sync got no authors at all for any other role. It now reads them the way WordPress answers every role: the
authors with published posts, by name, without e-mail. The sync names this as a gap.
- **An Author or Contributor sync reads only the changes, and sees a post deleted for good.** Each sync read every post
again, and a post deleted for good stayed in the copy. Later syncs now read only what changed. Once a day the sync
reads each post that left the list once more: a post the site deleted for good is marked deleted, and one the role
may no longer read stays as it was.
- **A post's text keeps its `-` list marker** instead of turning `- one` into `* one`.
- **`posts publish --at-time` with a past time names `--at-time`** in its error, not `--at`.

### Changed — may break callers

- **cli-core 0.716.0 and cli-base 0.125.3.** cli-base now marks a new application password in an answer as secret,
so the `api` group no longer offers any call whose answer can hold one: `users-application-passwords-create`,
`-list`, `-get`, `-update` and `-introspect-list`. The hand-written exclusion of that route is gone, and
`api users-application-passwords-delete-all` is back, asking first like every delete.
- **`posts.delete: deny` also stops `api pages-delete`.** A page's delete route checked only `pages.delete`, so the
content key did not reach it, as it already did for the posts route and for creating and updating a page.
1 change: 1 addition & 0 deletions contracts/help.snap
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Works with:
pbx Asterisk PBX calls and recordings, searchable with your other WireCat data
notion Notion pages and databases as local text, searchable with your other WireCat data
ydisk Yandex Disk folders as local text, searchable with your other WireCat data
linear Linear issues and projects, searchable with your other WireCat data

Next: wordpress commands every command, by section
wordpress help options output, offline, timeouts, dry run
Expand Down
4 changes: 1 addition & 3 deletions contracts/mcp-catalogue.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,8 @@
"api users-get": "read",
"api users-update": "write",
"api users-delete": "write",
"api users-application-passwords-get": "read",
"api users-application-passwords-update": "write",
"api users-application-passwords-delete-all": "write",
"api users-application-passwords-delete": "write",
"api users-application-passwords-introspect-list": "read",
"api users-me-get": "read",
"api users-me-create": "write",
"api users-me-delete": "write",
Expand Down
30 changes: 3 additions & 27 deletions contracts/wirecat.json
Original file line number Diff line number Diff line change
Expand Up @@ -1611,26 +1611,14 @@
{
"path": [
"api",
"users-application-passwords-get"
"users-application-passwords-delete-all"
],
"summary": "getWpV2UsersByUserIdApplicationPasswordsByUuid — read (GET…",
"effects": {
"remote": "read",
"local": "none"
},
"permission": "api.users-application-passwords-get"
},
{
"path": [
"api",
"users-application-passwords-update"
],
"summary": "postWpV2UsersByUserIdApplicationPasswordsByUuid — write (POST…",
"summary": "deleteWpV2UsersByUserIdApplicationPasswords — destructive (DELETE…",
"effects": {
"remote": "write",
"local": "none"
},
"permission": "api.users-application-passwords-update"
"permission": "api.users-application-passwords-delete-all"
},
{
"path": [
Expand All @@ -1644,18 +1632,6 @@
},
"permission": "api.users-application-passwords-delete"
},
{
"path": [
"api",
"users-application-passwords-introspect-list"
],
"summary": "getWpV2UsersByUserIdApplicationPasswordsIntrospect — read (GET…",
"effects": {
"remote": "read",
"local": "none"
},
"permission": "api.users-application-passwords-introspect-list"
},
{
"path": [
"api",
Expand Down
42 changes: 4 additions & 38 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -2448,40 +2448,21 @@ wordpress api users-delete [options]

**Example:** `wordpress personal api users-delete --id <value> --reassign <value>`

### `wordpress api users-application-passwords-get`
### `wordpress api users-application-passwords-delete-all`

getWpV2UsersByUserIdApplicationPasswordsByUuid — read (GET /wp/v2/users/{user_id}/application-passwords/{uuid})

```sh
wordpress api users-application-passwords-get [options]
```

| Option | What it does |
|---|---|
| `--user-id <value>` | user_id. |
| `--uuid <value>` | uuid. |
| `--context <value>` | Scope under which the request is made; determines fields present in response. |

**Example:** `wordpress personal api users-application-passwords-get --user-id <value> --uuid <value>`

### `wordpress api users-application-passwords-update`

postWpV2UsersByUserIdApplicationPasswordsByUuid — write (POST /wp/v2/users/{user_id}/application-passwords/{uuid})
deleteWpV2UsersByUserIdApplicationPasswords — destructive (DELETE /wp/v2/users/{user_id}/application-passwords)

**Changes something in the service.**

```sh
wordpress api users-application-passwords-update [options]
wordpress api users-application-passwords-delete-all [options]
```

| Option | What it does |
|---|---|
| `--user-id <value>` | user_id. |
| `--uuid <value>` | uuid. |
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Example:** `wordpress personal api users-application-passwords-update --user-id <value> --uuid <value>`
**Example:** `wordpress personal api users-application-passwords-delete-all --user-id <value>`

### `wordpress api users-application-passwords-delete`

Expand All @@ -2500,21 +2481,6 @@ wordpress api users-application-passwords-delete [options]

**Example:** `wordpress personal api users-application-passwords-delete --user-id <value> --uuid <value>`

### `wordpress api users-application-passwords-introspect-list`

getWpV2UsersByUserIdApplicationPasswordsIntrospect — read (GET /wp/v2/users/{user_id}/application-passwords/introspect)

```sh
wordpress api users-application-passwords-introspect-list [options]
```

| Option | What it does |
|---|---|
| `--user-id <value>` | user_id. |
| `--context <value>` | Scope under which the request is made; determines fields present in response. |

**Example:** `wordpress personal api users-application-passwords-introspect-list --user-id <value>`

### `wordpress api users-me-get`

getWpV2UsersMe — read (GET /wp/v2/users/me)
Expand Down
7 changes: 5 additions & 2 deletions docs/dev/API_COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Run: pnpm generate

# API coverage

147 operations from openapi unknown.
150 operations from openapi unknown.

| Operation | Call | Command | Effect | Request source | Status | Summary |
|---|---|---|---|---|---|---|
Expand Down Expand Up @@ -136,6 +136,9 @@ Run: pnpm generate
| `getWpV2UsersById` | `GET /wp/v2/users/{id}` | `wordpress <profile> api users-get` | read | — | generated | |
| `postWpV2UsersById` | `POST /wp/v2/users/{id}` | `wordpress <profile> api users-update` | write | contract | generated | |
| `deleteWpV2UsersById` | `DELETE /wp/v2/users/{id}` | `wordpress <profile> api users-delete` | destructive | — | generated | |
| `getWpV2UsersByUserIdApplicationPasswords` | `GET /wp/v2/users/{user_id}/application-passwords` | `wordpress <profile> api users-application-passwords-list` | read | — | generated | |
| `postWpV2UsersByUserIdApplicationPasswords` | `POST /wp/v2/users/{user_id}/application-passwords` | `wordpress <profile> api users-application-passwords-create` | write | contract | generated | |
| `deleteWpV2UsersByUserIdApplicationPasswords` | `DELETE /wp/v2/users/{user_id}/application-passwords` | `wordpress <profile> api users-application-passwords-delete-all` | destructive | — | generated | |
| `getWpV2UsersByUserIdApplicationPasswordsByUuid` | `GET /wp/v2/users/{user_id}/application-passwords/{uuid}` | `wordpress <profile> api users-application-passwords-get` | read | — | generated | |
| `postWpV2UsersByUserIdApplicationPasswordsByUuid` | `POST /wp/v2/users/{user_id}/application-passwords/{uuid}` | `wordpress <profile> api users-application-passwords-update` | write | contract | generated | |
| `deleteWpV2UsersByUserIdApplicationPasswordsByUuid` | `DELETE /wp/v2/users/{user_id}/application-passwords/{uuid}` | `wordpress <profile> api users-application-passwords-delete` | destructive | — | generated | |
Expand Down Expand Up @@ -243,6 +246,7 @@ Run: pnpm generate
| `postWpV2Templates` | `templates.publish` | always |
| `deleteWpV2UsersById` | `users.delete` | always |
| `deleteWpV2UsersById` | `users.delete.force` | query `force` is true |
| `deleteWpV2UsersByUserIdApplicationPasswords` | `users.delete` | always |
| `deleteWpV2UsersByUserIdApplicationPasswordsByUuid` | `users.delete` | always |
| `deleteWpV2UsersMe` | `users.delete` | always |
| `deleteWpV2UsersMe` | `users.delete.force` | query `force` is true |
Expand Down Expand Up @@ -284,7 +288,6 @@ Run: pnpm generate
- `/wp/v2/templates/(?P<parent>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w%-]+)/revisions/(?P<id>[\d]+)`: left out, as its value may hold a slash, which no path segment carries
- `/wp/v2/themes/(?P<stylesheet>[^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)`: left out, as its value may hold a slash, which no path segment carries
- `/wp/v2/users/(?P<id>[\d]+)`: PUT, PATCH left out, as POST does the same
- `/wp/v2/users/(?P<user_id>(?:[\d]+|me))/application-passwords`: excluded — its POST creates an application password and answers with it in clear. The CLI signs in through session start
- `/wp/v2/users/(?P<user_id>(?:[\d]+|me))/application-passwords/(?P<uuid>[\w\-]+)`: PUT, PATCH left out, as POST does the same
- `/wp/v2/users/me`: PUT, PATCH left out, as POST does the same
- `/wp/v2/widgets/(?P<id>[\w\-]+)`: PUT, PATCH left out, as POST does the same
Expand Down
2 changes: 2 additions & 0 deletions docs/dev/live-checks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
0.1.0 7e53d4b7c1019e891e3ecf90b6ab46ed18eb5f7b 2026-11-19 scripts/live.sh v2:066644ffc909024bc3fafdcc3719dea658a13d1f97b81f1f628b79fb010c63d4
0.1.1 96ac241ba20fab5610f82365bd5277eebf684ecb 2026-11-19 scripts/live.sh v2:7025787aec7dcfd8ec43a65d7cebd26ad2fc4c11b96c861e4d1f6fce669d1aa3
0.1.2 7cf92fea715012e3c113522ffcffb373f7e28066 2026-11-19 scripts/live.sh v2:4a1845a1d741d206b26a9d4ee86fa46753cf3095a74deb2cd96934d62f36de68
0.1.2 b25ff9d21928bf217c74ccd75f37174eb427ee4b 2026-11-21 scripts/live.sh v2:e4564e7d90c5a1ca41d2c157edf28ad61603970d622e423d6b70a1a67b9a2e73
0.1.2 60cde46dde8ddaa5c5d446d2054c12f34145e4e4 2026-11-21 scripts/live.sh v2:f167775a6dccda03576b9ac30fa10529f36b23b6842405c3eb1fa4979c789e79
16 changes: 3 additions & 13 deletions docs/dev/test-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ran it · ⛔ not tested offline, with the reason and where it is checked instea
Measured from the test run (`coverage/argv.jsonl`), not searched for — see
[TESTING.md](TESTING.md) for how, and for the states and failures that cut across commands.

**878 ✅ · 24 ⛔ · 0 ❌** — 192 commands, 710 options.
**868 ✅ · 24 ⛔ · 0 ❌** — 190 commands, 702 options.

| Command | Option | | Note |
|---|---|---|---|
Expand Down Expand Up @@ -719,21 +719,11 @@ Measured from the test run (`coverage/argv.jsonl`), not searched for — see
| `api users-delete` | `--id` | ✅ | |
| `api users-delete` | `--force` | ✅ | |
| `api users-delete` | `--reassign` | ✅ | |
| `api users-application-passwords-get` | | ✅ | |
| `api users-application-passwords-get` | `--user-id` | ✅ | |
| `api users-application-passwords-get` | `--uuid` | ✅ | |
| `api users-application-passwords-get` | `--context` | ✅ | |
| `api users-application-passwords-update` | | ✅ | |
| `api users-application-passwords-update` | `--user-id` | ✅ | |
| `api users-application-passwords-update` | `--uuid` | ✅ | |
| `api users-application-passwords-update` | `--body` | ✅ | |
| `api users-application-passwords-update` | `--body-file` | ✅ | |
| `api users-application-passwords-delete-all` | | ✅ | |
| `api users-application-passwords-delete-all` | `--user-id` | ✅ | |
| `api users-application-passwords-delete` | | ✅ | |
| `api users-application-passwords-delete` | `--user-id` | ✅ | |
| `api users-application-passwords-delete` | `--uuid` | ✅ | |
| `api users-application-passwords-introspect-list` | | ✅ | |
| `api users-application-passwords-introspect-list` | `--user-id` | ✅ | |
| `api users-application-passwords-introspect-list` | `--context` | ✅ | |
| `api users-me-get` | | ✅ | |
| `api users-me-get` | `--context` | ✅ | |
| `api users-me-create` | | ✅ | |
Expand Down
6 changes: 4 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ password.
- Only self-hosted WordPress with application passwords. WordPress.com sites are not supported.
- You paste the application password. Sign-in through the browser is on the [roadmap](roadmap.md).
- An Author or Contributor gets only their own posts, and no pages: WordPress refuses the pages list to both. A
Contributor gets only their drafts and posts waiting for review. For both, a post that leaves their view stays in
the copy as it was: one deleted for good, or a Contributor's post an editor published. Only an Administrator gets the users list. Sync reports each of these as a gap.
Contributor gets only their drafts and posts waiting for review. A post that leaves their view and that they may no
longer read stays in the copy as it was, such as a Contributor's post an editor published. Only an Administrator
gets every user with their e-mail; other roles get the authors with published posts. Sync reports each of these as
a gap.
- No view counts. WordPress itself keeps none, and Jetpack stats are not supported. `posts stats` shows only what the
copy has.
- Plugin fields, such as those of SEO or custom field plugins, have no flags. The `api` group sends them in a raw
Expand Down
5 changes: 3 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ permissions allow.
- A self-hosted WordPress site, version 5.7 or later, reached over https. WordPress makes application passwords only
there. WordPress.com sites are not supported.
- A user on the site. For a full copy, the user should be an Administrator. An Editor gets every post and page, but
WordPress lists the users to an Administrator only. An Author or Contributor gets only their own posts, and no pages:
WordPress refuses them the pages list. A Contributor gets only their drafts and posts waiting for review.
WordPress gives every user and their e-mail to an Administrator only: an Editor gets the authors with published
posts. An Author or Contributor gets only their own posts, and no pages: WordPress refuses them the pages list. A
Contributor gets only their drafts and posts waiting for review.
- For the command line: Node.js 22.16 or a later 22.x, or Node.js 24 or later. Node 23 is not supported.

## Install the tool
Expand Down
6 changes: 6 additions & 0 deletions docs/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ run it yourself in a terminal.
| `posts.delete.force` | `ask` | `posts delete --allow-delete`, which deletes for good. |
| Every read | `allow` | `sync`, `posts list`, `posts show` and the other reads. |

A write to a page goes through the pages routes, so it also checks their keys: `pages.publish` when it publishes or
schedules the page, or updates a page that is published or scheduled; `pages.delete` when it deletes the page, to the
trash or for good; and `pages.delete.force` with `--allow-delete`. Each asks by default. After a yes to the `posts`
key, the same action on the page is not asked again. `posts publish` and `posts unpublish` still ask `posts.update`
a second time, for a post and a page, until the next cli-core release.

## The api group

`wordpress blog api` reaches every WordPress operation, and checks the same publishing and deleting keys:
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ wordpress blog session status --check # asks your site whose password it is
| No **Application Passwords** section in your profile | The site needs WordPress 5.7 or later over https, and a plugin or the host may turn the section off. Ask the site's admin. |
| A WordPress.com address | WordPress.com sites are not supported, only self-hosted WordPress. |
| `posts list` is empty | Run `wordpress blog sync` first. Posts are read from the copy it makes. |
| `sync` names gaps, or pages are missing | An Author or Contributor sign-in cannot list pages and gets only their own posts; a Contributor only their drafts and posts waiting for review. Only an Administrator lists the users. Sign in as an Administrator for a full copy, or as an Editor for every post and page. |
| `sync` names gaps, or pages are missing | An Author or Contributor sign-in cannot list pages and gets only their own posts; a Contributor only their drafts and posts waiting for review. Only an Administrator gets every user with an e-mail; other roles get the authors with published posts. Sign in as an Administrator for a full copy, or as an Editor for every post and page. |
| A change on the site is missing from the copy | Run `sync`. If the post is not yours and you sign in as an Author or Contributor, see the row above. |
| `content.conflict` | The post changed on the site since the last sync. Run `sync`, look at the post again, then retry. |
| `content.lossy-body` | The post has galleries, columns, embeds or iframes that Markdown cannot keep. Change only its title, excerpt, tags or status, or add `--replace-body` to write the body anyway and flatten them. See [when a write stops](usage.md#when-a-write-stops). |
Expand Down
Loading
Loading