mirror of
https://github.com/openai/codex.git
synced 2026-10-23 18:08:45 +00:00
This is a follow-up to https://github.com/openai/codex/pull/15922. That previous PR deleted the old `tui` directory and left the new `tui_app_server` directory in place. This PR renames `tui_app_server` to `tui` and fixes up all references.
43 lines
1.1 KiB
Rust
43 lines
1.1 KiB
Rust
use clap::Parser;
|
|
use codex_arg0::Arg0DispatchPaths;
|
|
use codex_arg0::arg0_dispatch_or_else;
|
|
use codex_tui::Cli;
|
|
use codex_tui::run_main;
|
|
use codex_utils_cli::CliConfigOverrides;
|
|
|
|
#[derive(Parser, Debug)]
|
|
struct TopCli {
|
|
#[clap(flatten)]
|
|
config_overrides: CliConfigOverrides,
|
|
|
|
#[clap(flatten)]
|
|
inner: Cli,
|
|
}
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
arg0_dispatch_or_else(|arg0_paths: Arg0DispatchPaths| async move {
|
|
let top_cli = TopCli::parse();
|
|
let mut inner = top_cli.inner;
|
|
inner
|
|
.config_overrides
|
|
.raw_overrides
|
|
.splice(0..0, top_cli.config_overrides.raw_overrides);
|
|
let exit_info = run_main(
|
|
inner,
|
|
arg0_paths,
|
|
codex_core::config_loader::LoaderOverrides::default(),
|
|
/*remote*/ None,
|
|
/*remote_auth_token*/ None,
|
|
)
|
|
.await?;
|
|
let token_usage = exit_info.token_usage;
|
|
if !token_usage.is_zero() {
|
|
println!(
|
|
"{}",
|
|
codex_protocol::protocol::FinalOutput::from(token_usage),
|
|
);
|
|
}
|
|
Ok(())
|
|
})
|
|
}
|