Files
codex/codex-rs/stdio-to-uds/src/main.rs
Ruslan Nigmatullin 97d4b42583 uds: add async Unix socket crate (#18254)
## Summary
- add a codex-uds crate with async UnixListener and UnixStream wrappers
- expose helpers for private socket directory setup and stale socket
path checks
- migrate codex-stdio-to-uds onto codex-uds and Tokio-based stdio/socket
relaying
- update the CLI stdio-to-uds command path for the async runner

## Tests
- cargo test -p codex-uds -p codex-stdio-to-uds
- cargo test -p codex-cli
- just fmt
- just fix -p codex-uds
- just fix -p codex-stdio-to-uds
- just fix -p codex-cli
- just bazel-lock-check
- git diff --check
2026-04-20 15:59:05 -07:00

21 lines
529 B
Rust

use std::env;
use std::path::PathBuf;
use std::process;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let mut args = env::args_os().skip(1);
let Some(socket_path) = args.next() else {
eprintln!("Usage: codex-stdio-to-uds <socket-path>");
process::exit(1);
};
if args.next().is_some() {
eprintln!("Expected exactly one argument: <socket-path>");
process::exit(1);
}
let socket_path = PathBuf::from(socket_path);
codex_stdio_to_uds::run(&socket_path).await
}