A CLI that imports your Payload config, initializes the Local API and runs commands directly against your database. No server, API keys or MCP are needed. It can list and describe collections, query, create, update and delete documents, and upload or download media. Requires Node.js 22.12 or newer and Payload 3.
PayloadCMS CLI for AI agents and humans. Simple, direct access to your CMS data.
Installation
npm i payload-cli13
Stars
0
Forks
0
Open Issues
2 months ago
Last Updated
8
Weekly Downloads
v0.6.0
npm Version
189.4 KB
Unpacked Size
1
Dependencies
13+3 since Sep 6
| Date | Stars |
|---|---|
| Dec 5, 2026 | 13 |
| Dec 4, 2026 | 13 |
| Dec 3, 2026 | 13 |
| Dec 2, 2026 | 13 |
| Dec 1, 2026 | 13 |
| Nov 30, 2026 | 13 |
| Nov 29, 2026 | 13 |
| Nov 28, 2026 | 13 |
| Nov 27, 2026 | 13 |
| Nov 26, 2026 | 13 |
| Nov 25, 2026 | 13 |
| Nov 24, 2026 | 13 |
| Nov 23, 2026 | 13 |
| Nov 22, 2026 | 13 |
| Nov 21, 2026 | 13 |
| Nov 20, 2026 | 13 |
| Nov 19, 2026 | 13 |
| Nov 18, 2026 | 13 |
| Nov 17, 2026 | 13 |
| Nov 16, 2026 | 13 |
| Nov 15, 2026 | 13 |
| Nov 14, 2026 | 13 |
| Nov 13, 2026 | 13 |
| Nov 12, 2026 | 13 |
| Nov 11, 2026 | 13 |
| Nov 10, 2026 | 13 |
| Nov 9, 2026 | 13 |
| Nov 8, 2026 | 13 |
| Nov 7, 2026 | 13 |
| Nov 6, 2026 | 13 |
| Nov 5, 2026 | 13 |
| Nov 4, 2026 | 13 |
| Nov 3, 2026 | 13 |
| Nov 2, 2026 | 13 |
| Nov 1, 2026 | 13 |
| Oct 31, 2026 | 13 |
| Oct 30, 2026 | 13 |
| Oct 29, 2026 | 13 |
| Oct 28, 2026 | 13 |
| Oct 27, 2026 | 13 |
| Oct 26, 2026 | 13 |
| Oct 25, 2026 | 13 |
| Oct 24, 2026 | 13 |
| Oct 23, 2026 | 13 |
| Oct 22, 2026 | 13 |
| Oct 21, 2026 | 13 |
| Oct 20, 2026 | 13 |
| Oct 19, 2026 | 13 |
| Oct 18, 2026 | 13 |
| Oct 17, 2026 | 13 |
| Oct 16, 2026 | 13 |
| Oct 15, 2026 | 13 |
| Oct 14, 2026 | 13 |
| Oct 13, 2026 | 13 |
| Oct 12, 2026 | 13 |
| Oct 11, 2026 | 12 |
| Oct 10, 2026 | 12 |
| Oct 9, 2026 | 11 |
| Oct 8, 2026 | 11 |
| Oct 7, 2026 | 11 |
| Oct 6, 2026 | 11 |
| Oct 5, 2026 | 11 |
| Oct 4, 2026 | 11 |
| Oct 3, 2026 | 11 |
| Oct 2, 2026 | 11 |
| Oct 1, 2026 | 11 |
| Sep 30, 2026 | 11 |
| Sep 29, 2026 | 11 |
| Sep 28, 2026 | 11 |
| Sep 27, 2026 | 11 |
| Sep 26, 2026 | 11 |
| Sep 25, 2026 | 11 |
| Sep 24, 2026 | 11 |
| Sep 23, 2026 | 11 |
| Sep 22, 2026 | 11 |
| Sep 21, 2026 | 11 |
| Sep 20, 2026 | 11 |
| Sep 19, 2026 | 11 |
| Sep 18, 2026 | 11 |
| Sep 17, 2026 | 11 |
| Sep 16, 2026 | 11 |
| Sep 15, 2026 | 11 |
| Sep 14, 2026 | 11 |
| Sep 13, 2026 | 10 |
| Sep 12, 2026 | 10 |
| Sep 11, 2026 | 10 |
| Sep 10, 2026 | 10 |
| Sep 9, 2026 | 10 |
| Sep 8, 2026 | 10 |
| Sep 7, 2026 | 10 |
| Sep 6, 2026 | 10 |
3−5 since Sep 6
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 3 |
| Dec 4, 2026 | 3 |
| Dec 3, 2026 | 3 |
| Dec 2, 2026 | 2 |
| Dec 1, 2026 | 5 |
| Nov 30, 2026 | 6 |
| Nov 29, 2026 | 5 |
| Nov 28, 2026 | 5 |
| Nov 27, 2026 | 5 |
| Nov 26, 2026 | 5 |
| Nov 25, 2026 | 5 |
| Nov 24, 2026 | 2 |
| Nov 23, 2026 | 1 |
| Nov 22, 2026 | 3 |
| Nov 21, 2026 | 5 |
| Nov 20, 2026 | 7 |
| Nov 19, 2026 | 9 |
| Nov 18, 2026 | 11 |
| Nov 17, 2026 | 11 |
| Nov 16, 2026 | 11 |
| Nov 15, 2026 | 10 |
| Nov 14, 2026 | 9 |
| Nov 13, 2026 | 10 |
| Nov 12, 2026 | 11 |
| Nov 11, 2026 | 10 |
| Nov 10, 2026 | 11 |
| Nov 9, 2026 | 13 |
| Nov 8, 2026 | 14 |
| Nov 7, 2026 | 15 |
| Nov 6, 2026 | 11 |
| Nov 5, 2026 | 9 |
| Nov 4, 2026 | 8 |
| Nov 3, 2026 | 7 |
| Nov 2, 2026 | 7 |
| Nov 1, 2026 | 7 |
| Oct 31, 2026 | 7 |
| Oct 30, 2026 | 9 |
| Oct 29, 2026 | 8 |
| Oct 28, 2026 | 8 |
| Oct 27, 2026 | 9 |
| Oct 26, 2026 | 8 |
| Oct 25, 2026 | 9 |
| Oct 24, 2026 | 8 |
| Oct 23, 2026 | 6 |
| Oct 22, 2026 | 9 |
| Oct 21, 2026 | 9 |
| Oct 20, 2026 | 8 |
| Oct 19, 2026 | 9 |
| Oct 18, 2026 | 6 |
| Oct 17, 2026 | 9 |
| Oct 16, 2026 | 9 |
| Oct 15, 2026 | 8 |
| Oct 14, 2026 | 8 |
| Oct 13, 2026 | 9 |
| Oct 12, 2026 | 7 |
| Oct 11, 2026 | 8 |
| Oct 10, 2026 | 4 |
| Oct 9, 2026 | 4 |
| Oct 8, 2026 | 4 |
| Oct 7, 2026 | 4 |
| Oct 6, 2026 | 3 |
| Oct 5, 2026 | 4 |
| Oct 4, 2026 | 3 |
| Oct 3, 2026 | 4 |
| Oct 2, 2026 | 5 |
| Oct 1, 2026 | 3 |
| Sep 30, 2026 | 4 |
| Sep 29, 2026 | 4 |
| Sep 28, 2026 | 4 |
| Sep 27, 2026 | 5 |
| Sep 26, 2026 | 7 |
| Sep 25, 2026 | 6 |
| Sep 24, 2026 | 6 |
| Sep 23, 2026 | 6 |
| Sep 22, 2026 | 8 |
| Sep 21, 2026 | 8 |
| Sep 20, 2026 | 9 |
| Sep 19, 2026 | 6 |
| Sep 18, 2026 | 6 |
| Sep 17, 2026 | 7 |
| Sep 16, 2026 | 8 |
| Sep 15, 2026 | 6 |
| Sep 14, 2026 | 7 |
| Sep 13, 2026 | 5 |
| Sep 12, 2026 | 5 |
| Sep 11, 2026 | 5 |
| Sep 10, 2026 | 4 |
| Sep 9, 2026 | 6 |
| Sep 8, 2026 | 6 |
| Sep 7, 2026 | 8 |
| Sep 6, 2026 | 8 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1179965144-root)<a href="https://payloaddirectory.dev/plugins/1179965144-root"><img src="https://payloaddirectory.dev/badge/1179965144-root.svg" alt="Payload Directory"></a>README
PayloadCMS automation CLI for AI agents
Direct database access to PayloadCMS through the Local API. No server, no API keys, no MCP. Just commands.
Built for AI coding agents (Opencode, Claude Code, etc.) but works great for humans too.
cd your-payload-project
npx payload-cli collections # discover
npx payload-cli describe posts # understand schema
npx payload-cli describe posts --examples # see JSON field structures
npx payload-cli find posts --limit 5 # read
npx payload-cli create posts --data '{"title":"Hello"}' # write
Or point at a config directly:
npx payload-cli find posts --config ./src/payload.config.ts
| Command | Description |
|---|---|
collections | List all collections |
globals | List all globals |
describe <name> [--examples] | Show full schema (with sample JSON field structures) |
status | Instance status |
find <collection> | Query documents (--where, --limit, --sort, --select, --depth) |
find-by-id <collection> <id> | Get a single document |
create <collection> --data '{...}' | Create a document |
update <collection> <id> --data '{...}' | Partial update |
update-many <collection> --where --data | Bulk update |
delete <collection> <id> --confirm | Delete (previews first) |
delete-many <collection> --where --confirm | Bulk delete |
upload <collection> <file|dir> | Upload file(s) to an upload collection |
download <collection> <id|--where> | Download media to disk |
get-global <slug> | Read a global |
update-global <slug> --data '{...}' | Update a global |
Upload, download, and attach files to documents:
# Upload
payload-cli upload media ./hero.jpg --data '{"alt":"Hero image"}'
payload-cli upload media ./photos/ # bulk upload directory
# Download
payload-cli download media 6789abc --out ./downloads/
payload-cli download media --where '{"alt":{"contains":"hero"}}'
# Auto-upload and attach to a document field
payload-cli create pages --data '{"title":"About"}' --file 'heroImage=./hero.jpg'
payload-cli update pages <id> --data '{}' --file 'thumbnail=./thumb.png'
The --file flag auto-detects the target upload collection from the field schema, uploads the file, and injects the resulting ID.
| Flag | Description |
|---|---|
--json | Machine-readable JSON output |
--dry-run | Validate without writing |
--confirm | Confirm destructive operations |
--config <path> | Path to payload.config.ts |
--locale <code> | Locale for reading/writing localized fields (use all to see all locales) |
--fallback-locale <code> | Fallback locale for reads (use none to disable) |
--file 'field=./path' | Upload and attach file to a field |
--data @file.json | Read --data JSON from a file instead of inline |
--examples | Show example values for json fields (use with describe) |
--include-sensitive | Include password hashes, API keys, etc. |
payload-cli find posts --limit 5
|
v
Import your payload.config.ts
Initialize Payload Local API
payload.find({ collection: 'posts', limit: 5 })
Output result
No HTTP server needed. Connects directly to your database through Payload's own Local API.
The skills/ directory contains a Claude Code skill that teaches agents the discover-describe-read-write-verify workflow:
# Agents learn to:
# 1. payload-cli collections -> what exists?
# 2. payload-cli describe posts -> what fields?
# 3. payload-cli describe posts --examples -> what shape are json fields?
# 4. payload-cli find posts -> what data?
# 5. payload-cli create posts --data -> write
# 6. payload-cli find-by-id posts -> verify
MIT
Topics
payload arch skill
Claude Code skill enforcing a route, controller, service and store architecture in Payload projects
272v?
payload cms skills
Agent Skills that guide coding agents to build Payload CMS 3 and Next.js sites consistently
250v?
payload plugin tooling
Shared lint, format, TypeScript, build, test and CI config for developing Payload plugins
6039/wk0v4
payload dry run
Test create operations with full validation and hooks, then roll back so nothing is persisted
439/wk0v3
cli
Command-line tool for initializing projects, managing plugins and generating collections in Payload
30110/wk4v?
payload plugin template
Starter template for building Payload v3 plugins with a dev app, tests and Docker support
197v3