Skip to main content

run

Function run 

Source
pub async fn run(config: &Config) -> Result<QueryResult>
Expand description

Run one prompt through claude under config and return the typed result.

Side-effect-free: no printing, no exit, no TTY. Builds the Claude client (honouring timeout_secs), maps config onto a QueryCommand via the shared apply_session, executes, and surfaces schema-constrained output the same way the CLI does. Errors propagate as anyhow (the CLI maps them to typed exit codes; a programmatic caller inspects them directly).