Automated summary
Drives content in a Payload CMS instance from the command line through the payload-content CLI, covering direct CRUD, pull/push file-based sync, Lexical richtext editing, and locale handling.
Strengths
- Two complementary modes: targeted CRUD for small changes and JSON file sync for bulk edits or richtext work.
- Keeps responses small via --select, --depth, and --where instead of pulling whole documents.
- Dedicated lexical subcommands (add, remove, replace, set, diff, link) that avoid hand-rewriting the whole Lexical tree.
- A --dry-run flag on push to preview changes before committing them.
Limitations
- Assumes the payload-content CLI is already on PATH and that auth environment variables are configured.
- The Payload-side plugin is optional but gates _schema.json/_jsonschema.json files, virtual-field stripping, and custom endpoint metadata in discover.
- The --where filter uses Payload's JSON query syntax, which gets error-prone for anything beyond simple conditions.
Reach for it whenever an agent needs to read, update, or sync content in a Payload CMS instance without going through the admin UI.
Skip it if the payload-content CLI is not installed or the Payload instance is unreachable from the execution environment.
Security analysis
CautionNo obfuscated payloads, no curl|sh, no secret exfiltration, and no safety-disabling instructions — the content is straightforward documentation of a CMS management CLI. Risk is limited to the inherent power of the tool it wraps: authenticated create/update/delete/upload against a live CMS, plus remote URL fetches and reliance on configured credentials. That is legitimate for the stated purpose but warrants a caution rating rather than fully safe.
- •Skill drives an authenticated CMS CLI with write/delete capabilities (`delete`, `update`, `upload`), so misuse could alter or remove production content
- •`upload --url` fetches remote content from an arbitrary URL into the CMS
- •Relies on ambient credentials/environment variables for CMS auth (no scoping or confirmation guidance for destructive ops)
- •No explicit warning to avoid `delete` or to dry-run destructive operations (dry-run is only recommended for `push`)
Examples
Use payload-content to run discover, then update the article with slug 'hello' so its status field is 'published'. Use --select title,status and --depth 0 in the response.Pull the 'homepage' global into local JSON with payload-content, change the hero heading and subtitle, then run push --dry-run to preview the diff before pushing for real.List the lexical nodes of post 42 in locale en, add a paragraph node after the intro, then use lexical diff against the de locale file and lexical link --from en to sync the links.name: payload-content description: | Manages Payload CMS content via the payload-content CLI. Supports CRUD operations, content sync (pull/push), richtext editing, and locale management. Use when reading, creating, updating, deleting, or syncing CMS content, editing richtext nodes, or working with locales. user-invocable: false
Payload Content CLI
Manages Payload CMS content from the command line. Provides two modes: direct CRUD for simple changes and file-based content sync for bulk edits.
Overview
The payload-content CLI connects to a Payload CMS instance and exposes content operations. CRUD commands (find, update, create, delete, upload) work directly against the API. Content sync (pull → edit → push) downloads documents as JSON files for local editing.
Run payload-content --help to discover all commands and options.
Prerequisites
-
payload-contentCLI installed and on PATH -
Environment configured with required environment variables
-
Plugin is optional — needed only for
_schema.json/_jsonschema.jsonfiles, virtual-field stripping, and custom endpoint metadata indiscover. Runpayload-content discoverto check whether it is installed. To install it, add topayload.config.ts:import { contentCliPlugin } from "payload-content-cli/plugin"; export default buildConfig({ plugins: [contentCliPlugin()], });
Instructions
Step 1: Verify connectivity and discover the API
Before doing any real work, always run these two commands:
payload-content me # confirm auth works
payload-content discover # list collections, globals, and custom endpoints
discover lists available collection and global slugs. If the content-cli plugin is installed, it also lists custom endpoints registered by plugins (with descriptions and schemas).
Step 2: Choose the right mode for the task
- Quick CRUD (
find,update,create,delete,upload) — for simple, targeted changes: toggling a status, updating a title, uploading media, checking a field value. No local files needed. - Content sync (
pull→ edit →push) — for bulk edits, richtext changes, or when the full document structure is needed. Edit files locally and push once.
Start with CRUD. Escalate to content sync when constructing JSON inline becomes harder than editing files.
Important: For create, update, and request commands, prefer --file over --data. Write your JSON to a temporary file and pass it with --file. Only use --data for trivially small inline JSON (e.g. a single field). Never pipe cat into --data.
Step 3: Read schemas before editing
Read _schema.json files to understand field types. Fields with virtual: true are computed and read-only — never include them in updates.
Step 4: Minimize response size
- Use
--selectto request only needed fields. Works onfind,create, andupdate. - Use
--depth 0to avoid expanding relationships. Only increase depth when populated data is actually needed. - Use
--whereto scope operations:'{"slug":{"equals":"hello"}}'(Payload query syntax as JSON).
Step 5: Preview before writing
Use --dry-run on push to preview changes before committing them.
Step 6: Use lexical subcommands for richtext
Prefer lexical subcommands (add, remove, replace, set) over rewriting the entire Lexical tree. Use lexical list to see node structure first. Pipe nodes between files with lexical get and lexical add.
Step 7: Handle locales
Pull multiple locales (--locale en de), use lexical diff to compare, and lexical link --from to sync links between locale files.
Output
Commands return JSON to stdout. CRUD commands return the affected document(s). Content sync writes JSON files to a local content directory. payload-content status shows pending changes as a diff summary.
Examples
Quick read — only fetch what you need
payload-content find posts --where '{"slug":{"equals":"hello"}}' --select '{"title":true,"slug":true}' --depth 0
Quick update
# For non-trivial data, write a file and use --file
payload-content update posts <id> --file changes.json --select '{"id":true,"title":true}'
# For single-field updates, inline --data is fine
payload-content update posts <id> --data '{"title":"New Title"}' --select '{"id":true,"title":true}'
Bulk workflow
payload-content pull --collections posts
# ... edit files ...
payload-content status # see what changed
payload-content push --dry-run # preview
payload-content push # commit
Upload media
payload-content upload media --file ./photo.jpg --data '{"alt":"Hero image"}'
payload-content upload media --url "https://example.com/image.png" --data '{"alt":"Remote image"}'
echo '<svg>...</svg>' | payload-content upload media --filename icon.svg --data '{"alt":"Icon"}'
Richtext surgery
payload-content lexical list <file>
payload-content lexical add <file> --at 0 --position after --paragraph "New text."
Error Handling
| Error | Cause | Solution |
| -------------------------------- | ----------------------------------- | ----------------------------------------------------------- |
| Auth failure on any command | Missing or expired credentials | Run payload-content me to verify auth configuration |
| Virtual field in update payload | Included a virtual: true field | Read _schema.json and remove virtual fields from the data |
| Unexpected nested objects | Default depth expands relationships | Add --depth 0 to keep references as IDs |
| Push conflict or unexpected diff | Stale local files | Re-pull, review status, then push again |
Run payload-content <command> --help for full options on any command.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/payload-content-cli-mrwakbt9/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/payload-content-cli-mrwakbt9' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/payload-content-cli-mrwakbt9/download' --output '.skill-downloads/payload-content-cli-mrwakbt9/SKILL.md.part' && mv '.skill-downloads/payload-content-cli-mrwakbt9/SKILL.md.part' '.skill-downloads/payload-content-cli-mrwakbt9/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
Original excerpt: Prerequisites
-
payload-contentCLI installed and on PATH -
Environment configured with required environment variables
-
Plugin is optional — needed only for
_schema.json/_jsonschema.jsonfiles, virtual-field stripping, and custom endpoint metadata indiscover. Runpayload-content discoverto check whether it is installed. To install it, add topayload.config.ts:import { contentCliPlugin } from "payload-content-cli/plugin"; export default buildConfig({ plugins: [contentCliPlugin()], });
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/payload-content-cli-mrwakbt9/SKILL.md' && test -s '.skill-downloads/payload-content-cli-mrwakbt9/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/payload-content' && cp -R '.skill-downloads/payload-content-cli-mrwakbt9' '.claude/skills/payload-content'Cursor
test -f '.skill-downloads/payload-content-cli-mrwakbt9/SKILL.md' && test -s '.skill-downloads/payload-content-cli-mrwakbt9/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/payload-content' && cp -R '.skill-downloads/payload-content-cli-mrwakbt9' '.cursor/skills/payload-content'Codex
test -f '.skill-downloads/payload-content-cli-mrwakbt9/SKILL.md' && test -s '.skill-downloads/payload-content-cli-mrwakbt9/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/payload-content' && cp -R '.skill-downloads/payload-content-cli-mrwakbt9' '.agents/skills/payload-content'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/payload-content-cli-mrwakbt9'openskills read 'payload-content-cli-mrwakbt9'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/payload-content-cli-mrwakbt9/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
Writing Fragments
Content
Mine raw writing fragments through a relentless interview, without imposing structure. Capture ideas, quotes, and leading words for later use.
UI Copywriting & Auditing
Content
Write or audit user-facing UI copy including buttons, errors, empty states, and tooltips across the monorepo, following the design system source of truth.
Music MIDI Extraction
Content
Extracts the MIDI or score from an existing music production via the CogMusic MCP tool and confirms availability.