mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 06:04:43 +00:00
28 lines
743 B
Rust
28 lines
743 B
Rust
use clap::Parser;
|
|
use sandbox_agent::cli::{
|
|
init_logging, run_command, CliConfig, CliError, Command, GigacodeCli, OpencodeArgs,
|
|
};
|
|
|
|
fn main() {
|
|
if let Err(err) = run() {
|
|
tracing::error!(error = %err, "gigacode failed");
|
|
std::process::exit(1);
|
|
}
|
|
}
|
|
|
|
fn run() -> Result<(), CliError> {
|
|
let cli = GigacodeCli::parse();
|
|
let config = CliConfig {
|
|
token: cli.token,
|
|
no_token: cli.no_token,
|
|
gigacode: true,
|
|
};
|
|
let command = cli
|
|
.command
|
|
.unwrap_or_else(|| Command::Opencode(OpencodeArgs::default()));
|
|
if let Err(err) = init_logging(&command) {
|
|
eprintln!("failed to init logging: {err}");
|
|
return Err(err);
|
|
}
|
|
run_command(&command, &config)
|
|
}
|