Official Payload CLI for scaffolding projects and running migrations, type generation, job workers, and custom scripts in Payload apps.
$npx create-payload-app
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis
Payload exposes two official CLI surfaces in this repo: create-payload-app for bootstrapping or installing Payload into a Next.js app, and the in-project payload bin for migrations, code generation, workers, and custom scripts. It is a project-operations CLI for building and maintaining Payload apps rather than a remote content-management CLI.
What It Enables
- Scaffold a new Payload app or install Payload into an existing Next.js project, choosing templates, database setup, package manager, and initial env files.
- Run database migrations, generate TypeScript types and Drizzle schema, and regenerate admin import maps from the local Payload config.
- Execute background job workers and schedule handlers, or register project-specific
payload <name>scripts for seeders and other maintenance tasks.
Agent Fit
- Works best inside a checked-out Payload app with config and env already present, where commands become deterministic and scriptable.
- Good shell fit for CI and maintenance loops such as migrations, code generation, and worker processes, but output is mostly plain text or file writes instead of structured JSON.
- Setup still leans on interactive prompts unless template, database, and other flags are supplied up front; official MCP support exists through the separate
@payloadcms/plugin-mcppackage.
Caveats
- The entry is conceptually split across
create-payload-appand thepayloadbin, so users expecting one single CLI surface may find the packaging slightly confusing. - Most day-to-day content reads and writes happen through Payload APIs, app code, or the admin UI rather than through this CLI.