pub enum Command {
Show 23 variants
New(NewArgs),
Validate(ValidateArgs),
Fmt(FmtArgs),
Tokens(TokensArgs),
Render(RenderArgs),
Tx(TxArgs),
Inspect(InspectArgs),
Merge(MergeArgs),
Library(LibraryArgs),
History(HistoryArgs),
Undo(UndoArgs),
Redo(RedoArgs),
Version(VersionArgs),
Restore(RestoreArgs),
Sync(SyncArgs),
Variant(VariantArgs),
Update(UpdateArgs),
Theme(ThemeArgs),
Plugin(PluginArgs),
Mcp(McpArgs),
Fonts(FontsArgs),
Schema(SchemaArgs),
Workspace(WorkspaceArgs),
}Expand description
Top-level subcommands.
Variants§
New(NewArgs)
Scaffold a new minimal, valid .zen document at a fresh path.
Writes a minimal valid document (one page on a white background) at the
given path, with a doc-id already minted + stamped and its first
version recorded in history — a ready-to-edit “File > New” starting point.
A .zen extension is appended when the path has none, and any missing
parent directories are created. Refuses to overwrite an existing file.
The id slug is derived from --name when given, otherwise from the
path’s file stem; the default name is “Untitled”.
Validate(ValidateArgs)
Validate a .zen document and report diagnostics.
Validate a .zen document and report diagnostics. Hard (Error) diagnostics
block rendering — always validate and fix them before render. Exit code is non-zero when
hard diagnostics are present.
Fmt(FmtArgs)
Format a .zen document in-place (idempotent).
Tokens(TokensArgs)
List all design tokens and their resolved values.
List every design token and its resolved value. Visual properties must reference tokens, so this is how you discover the palette/type/spacing a document exposes before authoring or editing nodes.
Render(RenderArgs)
Compile and render a .zen document.
Compile and render a .zen document to PNG, PDF, or a scene display-list.
Rendering is deterministic (same source + backend → same bytes) and is blocked by hard
diagnostics, so validate first. Use --all-pages <DIR> for a contact sheet and --spread A-B for facing pages.
Tx(TxArgs)
Apply a transaction to a .zen document (dry-run by default).
Apply a typed transaction (a JSON edit script) to a .zen document. This is
the preferred way to edit existing documents: it is dry-run by default (shows a source + scene
diff), enforces id-uniqueness and referential integrity, and only writes with --apply.
Inspect(InspectArgs)
Print the node tree of a .zen document (read-only).
Print the structure of a .zen document (read-only): the node tree plus
document-level blocks such as the recipes provenance block. Use it to discover node ids before
writing a tx edit, to see which recipes a document declares, or to confirm what it contains.
Merge(MergeArgs)
Mail-merge a .zen template with a CSV data file, writing one PNG per row.
Mail-merge a .zen template with a CSV, writing one PNG per row. Mark variable
nodes with role="data.<column>" (text nodes substitute their text; image nodes substitute
their asset path) where <column> matches a CSV header. Use this for localized posts,
personalized graphics, certificates, badges, and campaign variants. For a SINGLE
data-bound render (first object/row, via (data)"field.path" references) use
zenith render --data instead.
Library(LibraryArgs)
Discover and materialize reusable design assets (tokens, components, actions).
Manages library packs: embedded @zenith/* presets and project-local packs
in libraries/*.zen. Run zenith library list to discover, zenith library show <pkg>#<item> to inspect, and zenith library add <pkg>#<item> --into <doc.zen> to materialize a token, component, or action into a document.
History(HistoryArgs)
List a document’s version history.
History is automatic: every tx --apply and edit is recorded in a durable
per-document version store kept beside the file (content-addressed; off the
render path). This lists those revisions with their version ids. The related
commands operate on that same store: undo/redo step the session, version
names the current state, restore <rev> rewinds to a past one, and sync
records an out-of-band external edit. Use the version ids shown here as the
<rev> argument to restore.
Undo(UndoArgs)
Undo the last edit, rewriting the document in place.
Redo(RedoArgs)
Redo the last undone edit, rewriting the document in place.
Version(VersionArgs)
Save the current document as a named version.
Restore(RestoreArgs)
Restore the document to a past version.
Rewinds the document to a past revision and rewrites it in place. The <rev>
argument accepts: a version id as listed by zenith history (e.g. v2);
@head or @head~N (the current head, or N steps back); @latest:<name>
(the most recent version saved under that name via zenith version); or a
bare version name. Run zenith history first to see the available revisions.
Sync(SyncArgs)
Capture the document’s current on-disk state into history as an external
change (e.g. after a GUI edit, hand-edit, or git checkout).
Variant(VariantArgs)
Generate size/format variants of a document (one design → many sizes).
Expands the variants block: one canonical page becomes N named target sizes (square,
story, banner), each written as a native .zen page plus a rendered PNG. Per-variant
overrides can hide/show nodes, swap text, or change a fill; source token edits propagate
to every variant. This varies DIMENSIONS — distinct from merge, which varies CONTENT
across CSV rows. Deterministic: same source → byte-identical outputs.
Update(UpdateArgs)
Update the installed zenith binary to a published release.
Theme(ThemeArgs)
Generate design themes (token packs) from brand colours.
Plugin(PluginArgs)
Install the Zenith agent skill into AI coding tools (Claude Code, Codex, OpenCode, …).
Mcp(McpArgs)
Run Zenith as an MCP server over stdio (for remote/CI/server agents).
Run Zenith as a Model Context Protocol (MCP) server over stdio, exposing the command surface (validate, inspect, tokens, fmt, render, tx, merge, theme) as MCP tools for any MCP-aware client.
For a LOCAL agent, prefer installing the CLI and the skill
(zenith plugin install) and running commands directly. This MCP server is for
environments where a local binary is not suitable (remote, CI, sandboxed, hosted agents) —
and it is a first-class surface there: tools return trimmed structured results, fetch schema
detail on demand (zenith_schema), hand back large/binary artifacts as resource links, and
drive the full scratch/candidate/promote/finalize workspace loop by doc-id.
Defaults to the stdio transport; pass --http <ADDR> for native Streamable-HTTP
(requires the http build feature).
Fonts(FontsArgs)
List fonts available to the renderer — bundled (portable) and local/system.
Discovers fonts in two clearly-separated sections:
Bundled (portable) — fonts shipped in the binary. Using these keeps renders byte-identical across machines.
Local / system (this machine only) — fonts in OS font directories.
Using these is NOT portable: renders may differ on another machine,
and they trip a font.local advisory.
Uses the same discovery code as the renderer so there is no drift.
Scanning reads every system font file on disk, so the command may take a
moment on machines with many fonts installed (similar to fc-list).
Schema(SchemaArgs)
Describe the Zenith document schema (node kinds, attributes, tx ops, and non-node surfaces).
Self-describing source of truth for agents and tooling. Reports every
authorable node kind with its one-line summary and recognized attribute
names, every transaction op with its summary, and the recognized
attributes for the non-node authorable surfaces (page, asset, document).
Attribute types, required-ness, and valid values are enforced at
document-level by zenith validate — run that command for the full
diagnostic loop.
Subcommands: nodes (all kinds), node <kind> (one kind + its
attributes), ops (all tx ops), op <name> (one op: summary,
fields, and a working JSON example), page, asset, document
(non-node surface attributes).
Bare zenith schema prints a short overview with counts and drill-in hints.
Workspace(WorkspaceArgs)
Manage workspace-level process state: scratch candidates and their lifecycle.
The workspace subsystem persists design scratch candidates — point-in-time
.zen snapshots that are evaluated and promoted or rejected — alongside
the durable version history. Use zenith workspace scratch to record and
inspect candidates; use zenith workspace candidate to transition their
lifecycle status (draft → selected | rejected).
Trait Implementations§
Source§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.