Skip to main content

Crate zenith_cli

Crate zenith_cli 

Source
Expand description

Command-line interface library for Zenith.

Owns all command dispatch, argument parsing (via clap), JSON I/O shaping, and human-readable stdout/stderr formatting.

src/main.rs is kept thin — it only calls run. zenith-layout is reached transitively through zenith-scene; the CLI never constructs layout types directly.

§Module layout

  • cli — clap #[derive(Parser)] types.
  • commands/ — one module per subcommand; all business logic is here, operating on in-memory bytes, never touching the FS.
  • json_types — serialisable DTOs for JSON output.
  • lib.rs — this file: wiring + run() dispatcher + file I/O edge.

Modules§

cli
Clap argument types for the Zenith CLI.
commands
Command implementations for the Zenith CLI.
config
Diagnostic-policy and brand-contract resolution from config files and command-line flags.
history
Local document-history recording (best-effort attach hook).
json_types
Serialisable DTO types for JSON output.
library
Zenith library subsystem: pack format, registry, and resolver.
mcp
zenith mcp — a token-efficient MCP server over stdio.
selfupdate
zenith update — self-update by piping the published install script to sh.

Functions§

run
Main entry point: parse CLI arguments, dispatch to the appropriate command, handle all file I/O, and return the appropriate exit code.