Skip to main content

codex/cli/
stdio_to_uds.rs

1use std::path::PathBuf;
2
3/// Request for `codex stdio-to-uds <SOCKET_PATH>`.
4#[derive(Clone, Debug, Eq, PartialEq)]
5pub struct StdioToUdsRequest {
6    /// Path to the Unix domain socket to connect to.
7    pub socket_path: PathBuf,
8    /// Optional working directory override for the spawned process.
9    pub working_dir: Option<PathBuf>,
10}
11
12impl StdioToUdsRequest {
13    pub fn new(socket_path: impl Into<PathBuf>) -> Self {
14        Self {
15            socket_path: socket_path.into(),
16            working_dir: None,
17        }
18    }
19
20    /// Sets the working directory used to resolve the socket path.
21    pub fn working_dir(mut self, dir: impl Into<PathBuf>) -> Self {
22        self.working_dir = Some(dir.into());
23        self
24    }
25}