OXYGENHUB
# 571572f5fb2c spectra / src / main.rs
887 B · Rust · last changed Project skeleton in Oxygen's shape: workspace, deps/oxygen pinned, make check, version, deps-check (#1) 2 days ago source blame history raw
1
//! `spectra`: the control plane for AI coding agents.
2
//!
3
//! Command definitions and dispatch live in `cli`; each command group has
4
//! its own module there, as in `oxy`.
5
6
mod cli;
7
8
// Many small allocations from every thread (events, JSON, templates): mimalloc
9
// serves them from per-thread pages without the arena locks of glibc's.
10
#[global_allocator]
11
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
12
13
fn main() {
14
    // Behave like other CLI tools when output is piped into `head`: die
15
    // quietly on SIGPIPE instead of panicking on a failed write.
16
    #[cfg(unix)]
17
    unsafe {
18
        libc::signal(libc::SIGPIPE, libc::SIG_DFL);
19
    }
20
    match cli::run() {
21
        Ok(code) => std::process::exit(code),
22
        Err(e) => {
23
            cli::ui::init(false);
24
            eprintln!("{} {e:#}", cli::ui::err("error:"));
25
            std::process::exit(1);
26
        }
27
    }
28
}