1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Rust SDK for the Claude CLI.
//!
//! This crate wraps the `claude` command-line tool, communicating via
//! newline-delimited JSON (NDJSON) over stdin/stdout using the
//! `--input-format stream-json --output-format stream-json` protocol.
//!
//! # Quick start
//!
//! ```rust,no_run
//! use apiari_claude_sdk::{ClaudeClient, SessionOptions};
//!
//! # async fn run() -> apiari_claude_sdk::error::Result<()> {
//! let client = ClaudeClient::new();
//! let mut session = client.spawn(SessionOptions {
//! model: Some("sonnet".into()),
//! allowed_tools: vec!["Bash".into(), "Read".into()],
//! ..Default::default()
//! }).await?;
//!
//! session.send_message("List files in the current directory").await?;
//!
//! while let Some(event) = session.next_event().await? {
//! match event {
//! apiari_claude_sdk::Event::Assistant { message, tool_uses } => {
//! for block in &message.message.content {
//! if let apiari_claude_sdk::types::ContentBlock::Text { text } = block {
//! print!("{text}");
//! }
//! }
//! // Handle tool_uses if needed...
//! drop(tool_uses);
//! }
//! apiari_claude_sdk::Event::Result(result) => {
//! println!("\nDone! Session: {}", result.session_id);
//! break;
//! }
//! _ => {}
//! }
//! }
//! # Ok(())
//! # }
//! ```
// Re-export the most commonly used types at the crate root.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;