zudo-diagram-gen

Type to search...

to open search from anywhere

GitHub repository

CLI reference

Supported commands, versioned responses, errors and safe recovery for installed consumers.

Run the installed binary through pnpm exec zudo-diagram-gen. --help and --version show that engine's interface. In syntax blocks below, angle brackets are values supplied by you. Local archive setup supplies the actual unpublished installation path. Agent slash arguments are explained separately under Core skill.

Initializer

node packages/create-zudo-diagram-gen/bin/create-zudo-diagram-gen.mjs <destination> [options]
create-zudo-diagram-gen <destination> [options]

The first form runs from source; the second requires a locally installed initializer archive or an independently verified registry release.

Argument / optionBehavior
[destination]New/empty caller directory; default diagram-session. Existing nonempty or symlink destinations reject.
--name <title>Display title; derives a safe package slug and a unique persisted ID.
--engine-package <spec>Engine spec or existing absolute .tgz/.tar.gz; relative local archives reject. Use local archives while unpublished.
--projectOne host with project.json and starter sessions/diagram.
--installOpt-in dependency installation. Failure retains resumable files.
--yes, -yNoninteractive compatibility option; defaults already deterministic.
--help, -h; --version, -vPrint interface or version.

No Git initialization or personal skill installation. Use -- before a destination beginning with a dash. Programmatic createProject accepts explicit multiple sessions; see API.

Create, inspect and resume

new --out <new-directory> --brief <file> [--project] [--install] [--engine-package <spec>] [--json]
inspect <session-or-project> [--review <file>] [--json]
resume <session-or-project> [--review <file>] [--json]

new writes empty content and a zfb host; it makes no drawing or model call. Brief is explicit UTF-8 Markdown (regular file, at most 1 MiB). Creation and continuation are distinct. Keep partially installed content; retry pnpm install within that host then resume.

Inspect/resume load saved files, optional downloaded JSON review and capture capability. They do not write source, access browser storage or start another conversation. For projects they return healthy sessions alongside diagnostics with ok:false when incomplete. Supplied review preserves IDs and notes and reports independent artwork/style/placement/capture compatibility; stale evidence requires fresh inspection and review. Browser readiness remains unknown even when the optional library resolves.

Check and tone resources

check [directory] [--json] [--json-version 1]
tones list [--json] [--json-version 1]
tones show <id> [--json] [--json-version 1]

Check validates structure/assets/lineage and requires a current valid project, including exact comparison coverage. It cannot judge facts or aesthetics. Tones list is concise. Show includes complete light/dark examples and resolved context: bundled local meaning, scheme, kit inventory and hashes. Installed resources are resolved from the package, not cwd. Tone context describes all-24 completeness and legacy/custom compatibility.

Development, build and preview

dev|build|preview [directory] [--host <host>] [--port <port>]

Directory defaults to cwd. These prepare package-owned routes and delegate to zfb; normal logs remain normal, without a JSON mode. Dev keeps last-valid snapshots visibly stale during invalid partial writes and recovers when repaired. Build is strict. Host and port are intended for dev/preview; port must be 1–65535. Use one host for a project and its registered session routes. Generated scripts provide pnpm dev, pnpm check, pnpm build, pnpm preview; fresh single-session and project hosts also have pnpm export:html, writing exports/diagram-review.html. Older project hosts may lack that script; use the explicit command below. Older generated single-session scripts may still target root diagram-review.html, which current source protection rejects. Use export-html . --out exports/review.html --json or explicitly update your own script to that safe output. Existing user scripts are not silently rewritten.

Capture

capture <candidate-id> --session <directory> --out <png> [--placement <file>] [--resource-root <dir>]
  [--theme light|dark] [--dpr <number>] [--crop frame|slot] [--timeout-ms <milliseconds>]
  [--browser-executable <existing-path>] [--force] [--json]

Defaults: light theme, DPR 1, frame crop, 30000ms timeout. DPR is 0.5–4; timeout 1000–60000ms. PNG and JSON sidecar both refuse existing outputs without force; force never permits source aliases. --placement resolves from the explicit resource root (session root by default). Nested sessions need the caller's project --resource-root; no ancestor lookup. Placement/capture describes optional setup, geometry, budgets, provenance and required actual image inspection.

Explicit project style

project lock <project> --tone <id> --palette <file> --selection <file> --revision <id> [--json]
project adopt <project> --revision <id> [--json]

Lock takes a complete two-theme palette and explicit session-qualified baseline selection. First lock adopts; later locks create pending immutable revisions and need explicit adopt. Browser choice, tone switching, shortlist or capture does not lock style. purpose:test is fixture intent, never user approval. Tone context covers snapshot validation, interruption recovery and stale baselines.

Export saved artwork and offline HTML

export <candidate-id> [--session <directory>] [--theme light|dark] --out <svg>
  [--resource-root <project>] [--json] [--json-version 1]
export-html [session-or-project] --out <html> [--force] [--json]

SVG defaults to cwd/light, copies exact validated saved UTF-8 bytes (including BOM/newlines), never regenerates, and fails for missing dark assets or mismatched declared hashes. Pass resource root explicitly for nested project style/input protection; omitted project validation is unknown. Ordinary repeated nonsource SVG overwrite remains supported.

HTML bundles one session or combined project data/assets/UI, not browser notes or live updates. Partial projects can retain unavailable slots with diagnostics; this is not strict acceptance. Download review JSON separately. Clipboard/storage may differ for detached file origins. No external fetch is needed for embedded content. Large embedded payloads are bounded; malformed/unsafe sources reject. Use exports/ inside a source root or an external directory. Outputs protect metadata, rounds, style, placement and symlink/hardlink aliases; HTML/capture existing outputs require force.

JSON envelopes and backward compatibility

New commands' --json, and legacy check/tones' --json-version 1, emit one object on stdout:

{
  "schemaVersion": 1,
  "command": "inspect",
  "ok": true,
  "data": {},
  "errors": [],
  "warnings": [{"code": "VISUAL_INSPECTION_REQUIRED", "message": "Actual image inspection is required."}]
}

This is a shape example, not a complete content response. Diagnostic entries are {code,message,path?}. Inspect/resume data contains content, transferred review, reviewEvidence, optional style, and capabilities; errors may coexist with useful partial data. Check data is validation output; tone data is catalog/context; exports/capture/create return their operation result. Invalid arguments may return data:null.

Bare legacy check --json keeps {ok,errors,warnings,summary}; tones list --json keeps version and concise tones; tones show --json keeps tone fields/examples plus additive context. Preserve existing legacy failure exit 1. Do not parse zfb logs as an envelope. JSON-mode optional installation logs go to stderr. Unknown/duplicate options reject. --json-version accepts only 1 and is supported by check, tones and SVG export, not every command.

ExitMachine codes / recovery
0Success. This does not imply semantic/visual/user approval.
1VALIDATION_FAILED, INCOMPLETE_PROJECT, STALE_INPUT: inspect diagnostics, repair affected files, inspect current images and supply renewed review. Preserve healthy siblings and old notes.
2INVALID_ARGUMENT, UNSUPPORTED_VERSION: correct unknown/duplicate flags, required arguments or requested JSON version.
3CAPTURE_UNAVAILABLE: explicitly install the optional library/browser or supply an existing executable; ordinary check/tone/export remain usable.
4RESOURCE_UNSAFE, OUTPUT_CONFLICT, IO_ERROR: choose safe paths, inspect conflicting/partial files, keep source unchanged; retry installation within retained host.
130CANCELLED: capture closes temporary server/browser; resume preserved content, retry explicitly.

A missing image is not replaced with a similar tone. A stale mapping is not automatically advanced to the current fingerprint. See Projects and the installed skill's references/scenarios.md for bounded recovery.