Expand description
Library root for the zenops binary.
Exposes the clap Cmd subcommand enum, the global Args, the
ColorChoice resolver, and the real_main dispatcher that routes a
parsed command into the right module.
Init, Doctor, and Schema are dispatched before Config::load
because they must work without — or independently of — a usable
~/.config/zenops/config.toml. Every other command goes through
Config::load first.
See crate::output for the structured-event channel that all commands
emit through; the zenops binary entrypoint wires up Cli and picks a
renderer.
Modules§
- config_
files - The materialiser: turns the parsed
Configinto desired-state events and applied-change events. - error
- Crate-wide error type.
- git
- Thin git wrapper used for the zenops config repo.
- line_
prompter - Single-line prompt abstraction for interactive commands.
- output
- Structured-event channel for command output.
- pkg_
list - Implementation of
zenops pkg. - pkg_
manager - Tiny abstraction over the host’s package manager.
- prompt
- Interactive confirmation for
zenops apply. - schema
zenops schema— dump JSON Schema for every structured surface.
Structs§
- Args
- Globals shared across every subcommand. Currently only
--color; lives in its own struct so subcommands can borrow it without redeclaring the flag.
Enums§
- Cmd
- Top-level subcommand. The variants map 1:1 to user-visible commands;
each is dispatched by
real_main(or, forCompletions, bymainbeforereal_mainis reached). - Color
Choice - User-facing color policy for the renderer and prompter, parsed from
--color. Resolve to a concrete on/off viaColorChoice::enabled;AutohonoursNO_COLORand the target stream’s TTY-ness.
Functions§
- real_
main - Dispatch a parsed
Cmdto its module.Init,Doctor, andSchemaare handled beforeConfig::loadso they remain usable on a fresh or broken machine; everything else loads the config first and then routes throughConfig/ConfigFiles.