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
45 changes: 26 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<p align="center">
<img src="https://raw.githubusercontent.com/WireCatLabs/wordpress-cli/main/docs/images/social-preview.png" alt="WordPress CLI for AI agents" width="100%">
</p>

# wordpress: WordPress CLI and MCP server for AI agents

<p align="center">
Expand All @@ -6,8 +10,8 @@
</p>

<p align="center">
<a href="https://github.com/WireCatLabs/wordpress-cli/blob/main/docs/index.md">Docs</a> ·
<a href="https://github.com/WireCatLabs/wordpress-cli/blob/main/docs/installation.md">Install</a> ·
<a href="https://wirecat.dev/en/docs/wordpress">Docs</a> ·
<a href="https://wirecat.dev/en/docs/wordpress/installation">Install</a> ·
<a href="https://github.com/WireCatLabs/wordpress-cli/blob/main/docs/usage.md">Usage</a> ·
<a href="https://discord.gg/DebENqbRrJ">Discord</a>
</p>
Expand Down Expand Up @@ -61,6 +65,9 @@ Agent: (runs wordpress blog posts create --title "Pricing in 2027" --text-file

## Quick start

In [WireCat Desktop](https://wirecat.dev/en/download), add WordPress from the tool list and give it your site, your
user name and an application password when it asks. Or in a terminal:

```sh
npm install -g @wirecat/wordpress-cli
wordpress skill install # the agent skill, for Claude Code, Codex, Gemini CLI and OpenClaw
Expand Down Expand Up @@ -108,22 +115,6 @@ days (`keep_successful_runs_for_days`). The first line above stops it.
More: [agents and MCP](https://github.com/WireCatLabs/wordpress-cli/blob/main/docs/mcp.md) ·
[permissions](https://github.com/WireCatLabs/wordpress-cli/blob/main/docs/permissions.md)

## What needs which key

- **Publishing** needs `<route>.publish` (`posts.publish`, `pages.publish`): a write that sets `status` to
`publish` or `future`, or that sets `date`, `date_gmt` or `password`, unless the same call sets `status` to
`draft`, `pending` or `private`. WordPress publishes a scheduled post whose date moves into the past, and a
password taken off a published post makes it public, with no status in the call. `private` is not public.
Where a route's `status` starts at `publish` (menu items, for one), each create needs the key, as the
write publishes unless it says otherwise.
- **Deleting** needs `<route>.delete`. With `force=true`, which deletes for good instead of moving to the trash,
it needs `<route>.delete.force` too. Both ask by default.
- WordPress's batch route (`batch/v1`) is never offered: one batch call would run other routes' writes past
their keys.

Known limit of the raw `api` group: WordPress publishes a scheduled post whose time has already passed (a
missed schedule) on any edit, a title change too. The CLI cannot see that without reading the post first.

## What it can do

### Read your posts
Expand Down Expand Up @@ -182,14 +173,30 @@ wordpress blog config show # each setting and wh
More: [permissions](https://github.com/WireCatLabs/wordpress-cli/blob/main/docs/permissions.md) ·
[settings](https://github.com/WireCatLabs/wordpress-cli/blob/main/docs/configuration.md)

### What needs which key

- **Publishing** needs `<route>.publish` (`posts.publish`, `pages.publish`): a write that sets `status` to
`publish` or `future`, or that sets `date`, `date_gmt` or `password`, unless the same call sets `status` to
`draft`, `pending` or `private`. WordPress publishes a scheduled post whose date moves into the past, and a
password taken off a published post makes it public, with no status in the call. `private` is not public.
Where a route's `status` starts at `publish` (menu items, for one), each create needs the key, as the
write publishes unless it says otherwise.
- **Deleting** needs `<route>.delete`. With `force=true`, which deletes for good instead of moving to the trash,
it needs `<route>.delete.force` too. Both ask by default.
- WordPress's batch route (`batch/v1`) is never offered: one batch call would run other routes' writes past
their keys.

Known limit of the raw `api` group: WordPress publishes a scheduled post whose time has already passed (a
missed schedule) on any edit, a title change too. The CLI cannot see that without reading the post first.

## Limits

- 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. 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 gets every user with their e-mail, and 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
Expand Down
Binary file added docs/images/social-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions docs/images/src/banner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>wordpress banner</title>
<!-- Rendered to ../social-preview.png by render.ts at 1280x640. The fonts are local, so the render needs no network. -->
<style>
html, body { margin: 0; width: 1280px; height: 640px; background: #000; overflow: hidden; }
body { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.name {
font: bold 168px/1 "DejaVu Sans Mono", monospace; letter-spacing: -2px;
background: linear-gradient(90deg, #1ad8ff 0%, #8a5cff 50%, #ff1fd6 100%);
-webkit-background-clip: text; background-clip: text; color: transparent;
}
.promise { margin-top: 44px; font: bold 48px/1.15 "DejaVu Sans", sans-serif; color: #eef3df; }
.detail { margin-top: 20px; font: 34px/1.2 "DejaVu Sans", sans-serif; color: #a9b8d9; }
.footer {
position: absolute; bottom: 44px; left: 0; right: 0; display: flex; align-items: center; justify-content: center;
gap: 16px; font: 30px/1 "DejaVu Sans", sans-serif; color: #a9b8d9;
}
.footer svg { height: 40px; width: auto; }
</style>
</head>
<body>
<div class="name">wordpress</div>
<div class="promise">WordPress CLI for AI agents</div>
<div class="detail">Posts offline as Markdown · drafts from your agent · MCP</div>
<div class="footer">part of <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 162.1 30" width="162" height="30" role="img" aria-label="WireCat"><g transform="scale(0.9375)"><circle cx="16" cy="16" r="16" fill="#4b53f0"/><path d="M9 21V11l4 4 3-4 3 4 4-4v10" fill="none" stroke="#fff" stroke-width="2.4" stroke-linejoin="round" stroke-linecap="round"/></g><g transform="translate(40 22.43)" fill="#eef3df"><path d="M3.87 0H11.37L13.82 -11.67H13.85L16.29 0H23.79L27.29 -14.85H21.96L19.85 -3.52H19.82L17.19 -14.85H10.48L7.87 -3.53H7.83L5.81 -14.85H0.52Z M29.3 0H34.12V-12.98H29.3ZM29.3 -17.15V-14.14H34.12V-17.15Z M47.4 -6.4H52.21Q52.21 -9.9 50.89 -11.5Q49.57 -13.09 46.48 -13.09Q43.45 -13.09 41.63 -11.6Q39.82 -10.1 39.82 -8.32L41.65 -7.05Q41.65 -8.2 42.51 -9.04Q43.38 -9.88 44.76 -9.88Q45.95 -9.88 46.67 -9.18Q47.4 -8.49 47.4 -6.4ZM36.87 0H41.67V-10.69L40.61 -12.98H36.87Z"/><path transform="translate(-1.6 0)" d="M62.6 0.14V-2.81Q60.86 -2.81 59.77 -3.57Q58.67 -4.31 58.67 -6.45Q58.67 -8.62 59.76 -9.39Q60.85 -10.19 62.49 -10.19Q64.16 -10.19 65.13 -9.52Q65.78 -9.02 65.98 -7.93H58.25V-5.12H70.72Q70.84 -5.71 70.84 -6.46Q70.84 -9.51 68.78 -11.33Q66.69 -13.12 62.47 -13.12Q58.43 -13.12 56.26 -11.38Q54.08 -9.63 54.08 -6.46Q54.08 -3.31 56.27 -1.58Q58.42 0.14 62.6 0.14ZM62.6 -2.81V0.14Q64.9 0.14 66.24 -0.18Q67.57 -0.48 68.7 -1.12Q69.82 -1.75 70.19 -2.71L66.05 -4.28Q65.7 -3.79 65.31 -3.46Q64.91 -3.14 64.26 -2.97Q63.63 -2.81 62.6 -2.81Z M80.96 0.09Q85.55 0.09 87.46 -1.79Q89.38 -3.67 89.38 -6.03H84.42Q84.42 -4.53 83.47 -3.83Q82.53 -3.13 80.9 -3.13Q79.22 -3.13 78.16 -3.96Q77.09 -4.79 77.09 -7.46Q77.09 -10.13 78.16 -10.96Q79.24 -11.78 80.9 -11.78Q82.54 -11.78 83.48 -11.1Q84.42 -10.41 84.42 -8.9H89.38Q89.38 -11.31 87.47 -13.15Q85.56 -14.99 80.96 -14.99Q76.39 -14.99 74.27 -13.03Q72.15 -11.07 72.15 -7.46Q72.15 -3.87 74.27 -1.89Q76.39 0.09 80.96 0.09Z M97.02 0.16Q98 0.16 98.87 0.01Q99.75 -0.13 100.47 -0.39Q101.18 -0.64 101.7 -0.97Q102.21 -1.29 102.46 -1.65L102.84 0H106.96V-7.86Q106.96 -9.68 106.03 -10.84Q105.1 -12 103.29 -12.56Q101.49 -13.11 98.85 -13.11Q97.57 -13.11 96.31 -12.94Q95.04 -12.76 93.95 -12.4Q92.85 -12.05 92.04 -11.49Q91.24 -10.93 90.88 -10.16L95.49 -8.47Q95.73 -9.02 96.25 -9.36Q96.76 -9.7 97.45 -9.86Q98.15 -10.02 98.88 -10.02Q99.9 -10.02 100.62 -9.83Q101.35 -9.64 101.75 -9.25Q102.15 -8.85 102.15 -8.21V-7.92H97.21Q95.61 -7.92 94.38 -7.69Q93.15 -7.46 92.33 -6.98Q91.5 -6.5 91.08 -5.76Q90.66 -5.01 90.66 -3.95Q90.66 -2.85 91.09 -2.07Q91.51 -1.28 92.34 -0.79Q93.16 -0.3 94.34 -0.07Q95.51 0.16 97.02 0.16ZM97.97 -2.75Q97.42 -2.75 96.96 -2.82Q96.51 -2.89 96.18 -3.04Q95.85 -3.2 95.68 -3.45Q95.5 -3.71 95.5 -4.11Q95.5 -4.51 95.67 -4.77Q95.83 -5.03 96.14 -5.17Q96.45 -5.31 96.92 -5.37Q97.38 -5.43 97.98 -5.43H102.05V-4.17Q101.74 -3.79 101.12 -3.46Q100.49 -3.13 99.68 -2.94Q98.86 -2.75 97.97 -2.75Z M117.3 0.19Q119.19 0.19 120.91 -0.19V-3.25Q119.88 -2.89 118.88 -2.89Q117.92 -2.89 117.37 -3.23Q116.83 -3.56 116.83 -4.66V-9.77H121.81V-12.98H116.83V-16.1H112.02V-12.98H108.24V-9.77H112.02V-3.57Q112.02 -1.51 113.59 -0.66Q115.17 0.19 117.3 0.19Z"/></g></svg> <span>· wirecat.dev</span></div>
</body>
</html>
29 changes: 29 additions & 0 deletions docs/images/src/render.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Renders banner.html to the README banner and the social preview: pnpm docs:images
import { spawnSync } from "node:child_process"
import { mkdtempSync, rmSync } from "node:fs"
import { tmpdir } from "node:os"
import { join } from "node:path"
import { fileURLToPath, pathToFileURL } from "node:url"

const CHROME = process.env.CHROME ?? "/usr/bin/google-chrome"
const SOURCE = fileURLToPath(new URL("banner.html", import.meta.url))
const OUTPUT = fileURLToPath(new URL("../social-preview.png", import.meta.url))

// A throwaway profile, so the render never opens the owner's Chrome profile.
const profile = mkdtempSync(join(tmpdir(), "banner-chrome-"))
const result = spawnSync(
CHROME,
[
"--headless",
"--disable-gpu",
"--hide-scrollbars",
"--force-device-scale-factor=1",
"--window-size=1280,640",
`--user-data-dir=${profile}`,
`--screenshot=${OUTPUT}`,
pathToFileURL(SOURCE).href,
],
{ stdio: "inherit" },
)
rmSync(profile, { recursive: true, force: true })
process.exitCode = result.status ?? 1
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"smoke:node": "node --experimental-strip-types scripts/sandboxed.ts node --experimental-strip-types scripts/smoke-bundle.ts",
"package:check": "pnpm smoke",
"docs:check": "cli-dev docs-check --rules scripts/docs-rules.ts --pages && cli-dev changelog fragments && pnpm docs:spell && rumdl check --config config/wirecat/rumdl.toml README.md SECURITY.md CHANGELOG.md CLAUDE.md AGENTS.md docs/*.md docs/dev/*.md && pnpm docs:lint",
"docs:images": "node docs/images/src/render.ts",
"docs:lint": "markdownlint-cli2",
"contracts:check": "cli-contract contracts/plan.json && cli-dev manifest --program dist/program.js --identity dist/wcat.js --check",
"security:no-leak": "cli-testing security no-leak . contracts/no-leak.json",
Expand Down
Loading