This sets up the scaffolding and basic flow for a TUI onboarding experience. It covers sign in with ChatGPT, env auth, as well as some safety guidance. Next up: 1. Replace the git warning screen 2. Use this to configure default approval/sandbox modes Note the shimmer flashes are from me slicing the video, not jank. https://github.com/user-attachments/assets/0fbe3479-fdde-41f3-87fb-a7a83ab895b8
31 lines
810 B
Rust
31 lines
810 B
Rust
use clap::Parser;
|
|
use codex_arg0::arg0_dispatch_or_else;
|
|
use codex_common::CliConfigOverrides;
|
|
use codex_tui::Cli;
|
|
use codex_tui::run_main;
|
|
|
|
#[derive(Parser, Debug)]
|
|
struct TopCli {
|
|
#[clap(flatten)]
|
|
config_overrides: CliConfigOverrides,
|
|
|
|
#[clap(flatten)]
|
|
inner: Cli,
|
|
}
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
arg0_dispatch_or_else(|codex_linux_sandbox_exe| 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 usage = run_main(inner, codex_linux_sandbox_exe).await?;
|
|
if !usage.is_zero() {
|
|
println!("{}", codex_core::protocol::FinalOutput::from(usage));
|
|
}
|
|
Ok(())
|
|
})
|
|
}
|