Skip to main content

Command

Enum Command 

Source
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 Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Finish for T

Source§

fn finish(self)

Does nothing but move self, equivalent to drop.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.