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 --yes
prosewire media-list
prosewire media-upload ./cover.webp --blog-id 00000000-0000-4000-8000-000000000000
prosewire media-delete 00000000-0000-4000-8000-000000000002 --yesrevisions and media-list are private reads and require content:read. create, update, and media-upload mutate data. restore, archive, and media-delete are destructive and refuse to run without explicit --yes confirmation. Restore saves the current post first. Archive removes the post from public surfaces. Media deletion permanently removes stored objects only when no current post refers to the asset. All private commands are limited to the publication and scopes of the supplied key.
media-upload recognizes .jpg, .jpeg, .png, .webp, and .avif. It reserves quota, sends the exact file bytes to the signed object-storage URL, completes image validation and processing, then prints the ready asset. The --blog-id value is the publication UUID, not its slug.
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.
import --data export.json [--media media.zip] previews a Prosewire portable export with a content:write destination key. Add --apply to create content and --preserve-states only when deliberately restoring public or scheduled states. Posts otherwise arrive as drafts. Existing content is never overwritten. See portable import for format limits and exact-artifact retry policy.