1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! `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_proc;
mod claude_skills;
mod cli;
mod clock;
mod commands;
mod dag;
mod defaults;
mod distro;
mod error;
mod event_log;
mod events;
mod executor;
mod fetch;
mod github;
mod manifest;
mod pipe;
mod python;
mod run_state;
mod scaffold;
mod sentinel;
mod tarball;
mod ulid;
mod volume;
mod worktree;
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),
Command::Run(args) => commands::run::run(&args),
Command::Status(args) => commands::status::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());
}
}