CMS CLI for AI agents

CMS CLI for AI agents.

content management is essential but repetitive. filling layouts, testing edge cases, seeding products, wiring relationships. the kind of work you don’t want to do twice.

I wanted to hand it off to an agent.

the problem with MCP

PayloadCMS ships an official MCP plugin. it seems to be the right answer. expose the CMS, let the model call it, done.

in practice it’s overcomplicated. it fails on the things you actually ship with: Lexical rich text, custom blocks, json fields and content.

agents live in terminals. they run commands, know bash and can course-correct. a CLI fits that loop exactly.

the tool

payload-agent — an open-source CLI that talks directly to PayloadCMS through its Local API.

no HTTP server. no API keys. no MCP. just commands.

pnpx payload-agent collections              # what exists?
pnpx payload-agent describe posts           # what's the shape?
pnpx payload-agent find posts --limit 5     # what's already here?
pnpx payload-agent create posts --data '{"title":"Hello"}'  # write

built for AI coding agents (Claude Code, Opencode, Cursor) but just as useful for humans working inside an existing project.

discover → describe → read → write → verify

the CLI ships with a skills for agents that teaches agents a five-step loop:

  1. list collections to discover the schema
  2. describe each one and the output is the actual TypeScript interface from payload-types.ts so the model sees the exact shape Payload expects
  3. read a few documents to learn the conventions
  4. write new content, previewed first with --dry-run
  5. verify by reading back what it just wrote

the describe command alone turns hallucinations into grounded edits. the model stops guessing and starts typing against a contract.

what it enables

one prompt → five fully populated products with authentic copy, images uploaded to the media collection and all products varianted you wanted.

I used this exact flow to seed and manage Kickwear and Sitnowood. content pipelines that used to take sometimes day now take minutes.

it also covers the boring parts: bulk updates, bulk deletes (previewed, confirmed), locale fallbacks & translations, media upload-and-attach in a single command, globals.

a plan for future

the CLI is for developers in a terminal. but there’s a whole other audience — marketing, ops, founders — who want to edit the CMS without opening an admin panel.

so I’m building payload-agent-plugin, a production-ready Payload plugin that brings the same agent workflow to Slack, Telegram, and WhatsApp.

add it to the config, configure model and a channel (slack, whatsapp, telegram and more), and your team manages content through natural-language chat. same discover → describe → read → write → verify loop, just behind a message interface instead of a terminal.

work in progress, but already feels like the right shape. compared to Payload’s official MCP it’s purpose-built for the chat surface - faster, narrower, and it actually handles rich text.

try it

cd your-payload-project
pnpx payload-agent collections

no install, no config. it reads your payload.config.ts and goes.

github

back to craft.