Skip to main content
Promote the current draft of a page in the active workspace to live. Visitors see the new version immediately on the next request. This page covers the synopsis, what the server-side promotion does, and the exit codes a CI step should branch on.

Synopsis

Arguments

Flags

Run gavai publish --help for the authoritative flag list, including whether the page ID may also be passed as a flag in this version of the CLI.

Behavior

The command calls POST /v1/workspaces/{slug}/pages-publish against the active workspace. The server snapshots the current draft, writes it as the new live version, and invalidates the edge cache for that page. The response includes the publish timestamp and the number of page drafts promoted; the CLI prints it as JSON. For the underlying endpoint’s full contract, see the Pages API reference.
This writes to the live site immediately. For experimentation, run gavai patch against a test workspace, verify the draft with gavai get, and only then publish to production.

Examples

Publish a single page:
Publish from CI after a successful build, branching on the exit code:

Exit codes

See CLI overview — exit codes for the full table.