Skip to main content

claude_code_cli_acp/
interactive.rs

1use std::{ffi::OsString, process::Stdio};
2
3use tokio::process::Command;
4
5use crate::compat::claude_probe::ClaudeCli;
6
7pub async fn run(args: Vec<OsString>) -> anyhow::Result<i32> {
8    let cli = ClaudeCli::from_env();
9    let mut command = Command::new(cli.executable());
10    command.args(args);
11    command.stdin(Stdio::inherit());
12    command.stdout(Stdio::inherit());
13    command.stderr(Stdio::inherit());
14    let status = command.status().await?;
15    Ok(status.code().unwrap_or(1))
16}