pub mod cli;
pub mod client;
pub mod config;
pub mod core;
pub mod files;
pub mod handoff;
pub mod hub;
pub mod hubwire;
pub mod launchd;
pub mod merge;
pub mod plan;
pub mod run;
pub mod server;
pub mod summary;
pub mod supervisor;
#[cfg(test)]
pub mod testbin;
pub fn run_cli(args: &[String], json: bool) -> i32 {
match args.first().map(String::as_str).unwrap_or("status") {
"run" => match config::AgentConfig::from_env() {
Ok(cfg) => run::run(cfg),
Err(e) => {
eprintln!("zc agent: {e}");
1
}
},
"install" => cli::install(),
"uninstall" => cli::uninstall(),
"status" => cli::status(json),
other => {
eprintln!("usage: zc agent [run|install|uninstall|status [--json]] (got '{other}')");
2
}
}
}