Automate publishing with the CLI
Install the Prosewire CLI, configure a scoped key, and distinguish reads from mutations.
Install
pnpm add --global @prosewire/cli
prosewire --helpThe CLI supports Node.js 24 or newer.
Use --url to override PROSEWIRE_API_URL, --blog to override PROSEWIRE_BLOG, and --key to override PROSEWIRE_API_KEY. The URL defaults to http://localhost:3000; a publication slug is always required for public reads.
Read public content
export PROSEWIRE_API_URL=https://your-prosewire-deployment
export PROSEWIRE_BLOG=fieldnotes
prosewire posts --search portable
prosewire get shipping-with-confidenceposts and get are read-only. They use public endpoints and do not require an
API key.
Mutate content
Create a publication-scoped key in Integrate → Scoped API keys, grant
content:write, and keep it out of shell history and committed files.
export PROSEWIRE_API_KEY=pw_live_...
prosewire create --data post.json
prosewire update 00000000-0000-4000-8000-000000000000 --data changes.json
prosewire revisions 00000000-0000-4000-8000-000000000000
prosewire restore 00000000-0000-4000-8000-000000000000 00000000-0000-4000-8000-000000000001 --yes
prosewire archive 00000000-0000-4000-8000-000000000000 --yesrevisions reads private history and requires content:read. create and update are mutating. restore and archive are destructive and refuse to run without explicit --yes confirmation. Restore saves the current post first. Archive removes the post from public surfaces. All private commands are limited to the publication and scopes of the supplied key.
JSON request files
Create accepts the management API’s post-create shape. blogId and authorId are UUIDs, not slugs:
{
"blogId": "00000000-0000-4000-8000-000000000000",
"authorId": "00000000-0000-4000-8000-000000000001",
"title": "Shipping with confidence",
"slug": "shipping-with-confidence",
"contentMarkdown": "## Start here\n\nWrite the useful part first.",
"status": "draft",
"locale": "en"
}Update accepts a partial post body, for example:
{
"seoTitle": "Shipping with confidence",
"seoDescription": "A practical release checklist.",
"status": "published"
}Use an existing authenticated post response or portable export to resolve publication and author IDs. The current management API does not expose a standalone author-list endpoint.