oxi/main_dispatch.rs
1//! Single-prompt helper shared by the binary entry and integration tests.
2//!
3//! Kept separate from `bootstrap.rs` because it is also called by tests.
4
5use anyhow::Result;
6use crate::App;
7
8/// Run a single prompt and print the response.
9pub async fn run_single_prompt(app: App, prompt: &str) -> Result<()> {
10 let response = app.run_prompt_with_events(prompt.to_string(), |_event| {}).await?;
11 println!("{response}");
12 Ok(())
13}