claude-code 0.1.2

A Rust library for executing Claude Code CLI
Documentation
1
2
3
4
5
6
7
8
9
10
11
#[tokio::main]
async fn main() {
    let prompt = std::env::args()
        .nth(1)
        .unwrap_or_else(|| "Say hello".into());
    let client = claude_code::ClaudeClient::new(claude_code::ClaudeConfig::default());
    match client.ask(&prompt).await {
        Ok(resp) => println!("{resp:#?}"),
        Err(e) => eprintln!("Error: {e}"),
    }
}