Skip to main content

Crate zenops

Crate zenops 

Source
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 Config into 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, for Completions, by main before real_main is reached).
ColorChoice
User-facing color policy for the renderer and prompter, parsed from --color. Resolve to a concrete on/off via ColorChoice::enabled; Auto honours NO_COLOR and the target stream’s TTY-ness.

Functions§

real_main
Dispatch a parsed Cmd to its module. Init, Doctor, and Schema are handled before Config::load so they remain usable on a fresh or broken machine; everything else loads the config first and then routes through Config / ConfigFiles.