The mozaik CLI

npm i -g @mozaik/cli — open a store as a project, edit design as files, push drafts, propose changes. The CLI carries X-Mozaik-Client on every request; a build below the platform's supported floor is refused with HTTP 426 (exit code 3) and the exact upgrade command. Credentials live in ~/.config/mozaik/credentials.json or MOZAIK_API_TOKEN — never inside a project.

Exit codes: 0 ok · 1 error · 2 usage · 3 version/format refusal · 4 conflict (draft moved; the server never merges).

project

commandwhat it does
mozaik open <storeId> [--workspace ws_…|main] [--from draft|live] [--dir path] [--non-interactive]Open a store as a project: Tree v1 + mozaik.json + AGENTS.md + .mcp.json + pinned package.json. Idempotent (≈ pull).
mozaik pull [--force]Re-sync the tree from the server draft (or live). Refuses to overwrite local edits without --force.
mozaik statusLocal changes vs the lock, remote draft rev, platform drift.
mozaik diff [--remote|--live]File-level diff vs the last sync (default), the server draft, or the live design.

design

commandwhat it does
mozaik pushValidate server-side, then save the tree as the workspace draft under optimistic concurrency (409 = exit 4, never merged).
mozaik publish [--label text]Publish the workspace draft to the live store. Developer tokens with the design:publish scope only — agents propose instead.
mozaik devWatch design/, push on change, print the stable workspace preview URL. Pauses on conflict.
mozaik previewPrint the stable preview URL of the workspace draft.
mozaik validateAssemble the tree and run the server-side bundle checks without saving.

data

commandwhat it does
mozaik cmd <name> [--payload '<json>'|@file] [--dry-run] [--note text]Run one command through the command bus (agents: recorded as a proposal item).
mozaik audit [--entity id] [--actor merchant|agent|cli|system] [--limit n]Recent audit rows.
mozaik catalog export|plan|apply [--dry-run]Export catalog to jsonl files; plan/apply row diffs as idempotent commands (one storefront bump).
mozaik media manifest|pushSync media/manifest.json; upload files from media/uploads/.

agents

commandwhat it does
mozaik propose [--title text] [--message text]Submit your open proposal for owner review (agent tokens).
mozaik proposal list|status [id]|withdraw <id>Inspect or withdraw proposals this token created.
mozaik ext ops <extensionId>An installed extension's agent operations and their live readiness.
mozaik workspace list|attach <ws>List workspaces; point this project at another workspace (owner/developer).
mozaik dev-mcpStdio MCP server for editors/agents: docs search, schemas and validators for the CURRENT platform build. No auth.

platform

commandwhat it does
mozaik login [--token mzk_…] [--origin URL]Store an API token (developer or agent) for this machine — kept in ~/.config/mozaik/credentials.json, never in a project.
mozaik whoamiWhich store, token kind, scopes and workspace this credential resolves to.
mozaik metaPlatform build identity: buildId, apiVersion, registry hashes, CLI floor/latest.
mozaik log [--limit n]Versions, audit entries and proposals, interleaved newest-first.
mozaik commandsThe command registry visible to this token (name + summary).
mozaik routesThe typed route catalog visible to this token.
mozaik upgradeRe-pin the project to the current platform build (package.json, .mcp.json, lock).

Project layout (Tree v1)

mozaik.json          project manifest (format, store, workspace, pinned CLI) — no secrets
.mozaik/base.lock    last-sync state (platform build, draft rev/hash, file hashes)
AGENTS.md            how agents should work here (CLAUDE.md = @AGENTS.md)
.mcp.json            MCP wiring: hosted admin MCP + local dev-mcp, both pinned
design/              the store design as files (assembled hash == server hash)
catalog/*.jsonl      optional catalog export
media/manifest.json  media inventory
sections/ islands/ hooks/ css/   reserved
Generated from the live platform registries at build time — reference pages cannot go stale. Markdown variant: /reference/cli.md