paigasus_helikon_cli/
lib.rs1pub mod cli;
7pub mod eval_cmd;
8pub mod mcp_cmd;
9pub mod model;
10pub mod registry;
11pub mod repl;
12pub mod rhai_tool;
13pub mod sidecar;
14
15use clap::Parser as _;
16use std::process::ExitCode;
17
18pub fn main() -> ExitCode {
20 let cli = cli::Cli::parse();
21 let runtime = match tokio::runtime::Runtime::new() {
22 Ok(rt) => rt,
23 Err(e) => {
24 eprintln!("failed to start runtime: {e}");
25 return ExitCode::FAILURE;
26 }
27 };
28 match runtime.block_on(run(cli)) {
29 Ok(code) => code,
30 Err(e) => {
31 eprintln!("error: {e:#}");
32 ExitCode::FAILURE
33 }
34 }
35}
36
37async fn run(cli: cli::Cli) -> anyhow::Result<ExitCode> {
38 match cli.command {
39 cli::Command::Repl(args) => repl::run(args).await,
40 cli::Command::Eval { command } => match command {
41 cli::EvalCommand::Run(args) => eval_cmd::run(args).await,
42 },
43 cli::Command::Mcp { command } => match command {
44 cli::McpCommand::Serve(args) => mcp_cmd::serve(args).await,
45 },
46 }
47}