omne-cli 0.1.2

CLI for managing omne volumes: init, upgrade, and validate kernel and distro releases
Documentation
//! `omne` — CLI entrypoint.
//!
//! Parses the clap `Cli` struct, dispatches via an exhaustive match on
//! `cli::Command`, maps `CliError` variants to exit codes (0 success,
//! 1 logical error; clap parse failures exit 2 via clap itself), and
//! prints errors to stderr with a red `error:` prefix.

mod claude_skills;
mod cli;
mod commands;
mod defaults;
mod distro;
mod error;
mod fetch;
mod github;
mod manifest;
mod python;
mod scaffold;
mod tarball;
mod volume;

use clap::Parser;

use crate::cli::{Cli, Command};

fn main() {
    let parsed = Cli::parse();

    let result = match parsed.command {
        Command::Init(args) => commands::init::run(&args),
        Command::Upgrade(args) => commands::upgrade::run(&args),
        Command::Validate(args) => commands::validate::run(&args),
    };

    if let Err(err) = result {
        // Red "error:" prefix. ANSI escapes work on modern Windows
        // terminals (Windows 10+ with VT enabled) and all Unix TTYs.
        // Proper TTY-aware coloring via `anstream` / `indicatif` lands
        // in Phase 2 when the progress bar needs it.
        eprintln!("\x1b[31merror:\x1b[0m {err}");
        if let error::CliError::ValidationFailed { issues } = &err {
            for issue in issues {
                eprintln!("  - {issue}");
            }
        }
        std::process::exit(err.exit_code());
    }
}