Expand description
Shared clap chassis for the *ctl CLIs.
Not a command. Import as ctl_core. Models
(Envelope, ColorMode, OutputFormat) come first. View
picks pretty, JSON, or colorless. JSON never contains ANSI.
§Cargo features
cli(enabled by default) — Clap derive helpers (OutputArgs,DryRunArgs) and parser defaults.color(enabled by default) — ANSI streams (anstream/anstyle).json(enabled by default) — Serde models and the JSON view.schema— JSON Schema for the envelope and enums (schemars).help(enabled by default) — Styled-h/--helptables (forkctl / state-sync).view(enabled by default) — Pretty / JSON / colorless emitters over serializable models.
Unused features do not compile clap, comfy-table, or schemars.
Crate docs live here. The GitHub README is not rustdoc.
Re-exports§
pub use color::ColorMode;pub use flags::ColorLong;pub use flags::DryRunArgs;pub use flags::FlagWarning;pub use flags::FormatArgs;pub use flags::OutputArgs;pub use flags::WarningKind;pub use flags::chassis_warnings;pub use flags::emit_warnings;pub use flags::resolve_color;pub use flags::switch;pub use flags::warn_opposites;pub use format::OutputFormat;pub use model::Envelope;pub use model::ErrorBody;pub use model::SCHEMA_VERSION;pub use run::main as run;pub use table::grid;pub use table::kv;pub use view::Pretty;pub use view::Render;pub use view::View;pub use view::render_template;
Modules§
- color
- Color policy (
auto/always/never). - flags
- Clap flatten structs for shared flags. Shared clap flatten structs.
- format
- Output representation (
pretty/json). - help
- Styled
-h/--helprenderer. - layout
- Terminal width helpers for help tables. Terminal width helpers for help tables.
- model
- Schema-first wire types. Schema-first wire types. Views render these; they do not own data.
- parser
- Parser defaults (
-h/-Vstay on). Parser defaults.-h/--helpand-V/--versionstay on. - prelude
- One-import surface for a *ctl binary (
use ctl_core::prelude::*). Import once in a *ctlmain.rs. - run
- Process
ExitCodewrapper. Process exit wrapper. - style
- ANSI styles for pretty views. ANSI styles for pretty views.
- table
- Compact pretty tables for command output. Compact pretty tables for command output.
- view
- Pretty / JSON / colorless emitters. Multi-view emit: one serializable model, pretty or JSON, color or not.