@pith-cms/cli
v0.3.0
Published
Command-line scaffolding, collection management, content inspection, and diagnostics for Pith.
Maintainers
Readme
@pith-cms/cli
Command-line scaffolding, collection management, content inspection, and diagnostics for Pith.
Installation
pnpm add -D @pith-cms/cli@latestCommands
pith init
Scaffold a Pith integration in an existing Next.js App Router project.
pnpm pith initOptions:
--yes— Skip confirmation prompts--no-install— Skip dependency installation--dry-run— Preview changes without writing--storage <filesystem|github>— Storage adapter (default: filesystem)
pith collection add
Add a new collection definition interactively.
pnpm pith collection addpith content check
Validate all content entries against their collection schemas.
pnpm pith content check
pnpm pith content check --jsonpith content list <collection>
List all entries in a collection.
pnpm pith content list pages
pnpm pith content list pages --jsonpith content read <collection> <identifier>
Read and display a single content entry.
pnpm pith content read pages home
pnpm pith content read pages home --jsonpith doctor
Diagnose the Pith setup and report issues.
pnpm pith doctor
pnpm pith doctor --jsonpith auth
Generate authentication material.
pnpm pith auth hash-password
pnpm pith auth generate-secretConfiguration Discovery
The CLI discovers configuration by searching for (in order):
pith.config.tspith.config.mtspith.config.jspith.config.mjs
Use --config <path> to specify a custom location.
Environment
The CLI loads .env.local and .env with the following precedence:
- Shell environment variables (highest)
.env.local.env
Exit Codes
0— Success1— Invalid content or failed diagnostics2— Usage error, configuration error, or repository setup failure
