aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
35
akode-rs/exec-server-cli/src/lib.rs
Normal file
35
akode-rs/exec-server-cli/src/lib.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
//! Startup shared by the full Codex CLI and the standalone executor.
|
||||
//! Internal sandbox and filesystem re-exec modes always dispatch before argument parsing.
|
||||
|
||||
use clap::CommandFactory;
|
||||
use clap::Parser;
|
||||
use akode_utils_cli::CliConfigOverrides;
|
||||
use akode_utils_cli::collect_config_overrides;
|
||||
|
||||
mod command;
|
||||
mod config;
|
||||
mod exec_server_auth;
|
||||
mod exec_server_credential;
|
||||
mod exec_server_telemetry;
|
||||
|
||||
pub use command::ExecServerCommand;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(name = "akode-exec-server", bin_name = "akode-exec-server", version)]
|
||||
struct ExecServerCli {
|
||||
#[command(flatten)]
|
||||
config_overrides: CliConfigOverrides,
|
||||
#[command(flatten)]
|
||||
command: ExecServerCommand,
|
||||
}
|
||||
|
||||
/// Starts the executor after dispatching internal helper modes and preparing runtime paths.
|
||||
pub fn run_standalone() -> anyhow::Result<()> {
|
||||
akode_arg0::arg0_dispatch_or_else(|paths| async move {
|
||||
let args: Vec<_> = std::env::args_os().collect();
|
||||
let mut cli = ExecServerCli::parse_from(&args);
|
||||
cli.config_overrides = collect_config_overrides(ExecServerCli::command(), args)
|
||||
.unwrap_or_else(|error| error.exit());
|
||||
cli.command.run(&paths, &cli.config_overrides).await
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user