| Crates.io | iflow-cli-sdk-rust |
| lib.rs | iflow-cli-sdk-rust |
| version | 0.1.6 |
| created_at | 2025-10-16 18:46:58.40113+00 |
| updated_at | 2025-10-23 16:07:17.793087+00 |
| description | Rust SDK for iFlow CLI using Agent Client Protocol |
| homepage | |
| repository | https://github.com/vibe-ideas/iflow-cli-sdk-rust |
| max_upload_size | |
| id | 1886540 |
| size | 252,588 |
A powerful Rust SDK for interacting with iFlow using the Agent Client Protocol (ACP). This SDK provides both simple query functions and full bidirectional client for complex interactions.
agent_idAdd this to your Cargo.toml:
[dependencies]
iflow-cli-sdk-rust = "0.1.0"
Or install directly from the crate.io or GitHub repository:
cargo add iflow-cli-sdk-rust
# or
cargo add --git https://github.com/vibe-ideas/iflow-cli-sdk-rust
use iflow_cli_sdk_rust::query;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let response = query("What is 2 + 2?").await?;
println!("{}", response); // "4"
Ok(())
}
The SDK handles various message types from iFlow:
Message::Assistant { content } - AI assistant responsesMessage::ToolCall { id, name, status } - Tool execution requestsMessage::Plan { entries } - Structured task plansMessage::TaskFinish { reason } - Task completion signalsMessage::Error { code, message } - Error notificationsMessage::User { content } - User message echoesRun the examples:
# Simple query example
cargo run --example query
# use WebSocket communication instead of stdio.
cargo run --example websocket_client
# MCP Servers
cargo run --example mcp_example
The SDK is organized into several modules:
client - Main IFlowClient implementation with stdio communicationtypes - Type definitions and message structuresprocess_manager - iFlow process lifecycle managementquery - Convenience functions for simple querieserror - Error types and handlinglogger - Message logging functionality--experimental-acp support (or use auto-start feature)cargo build
cargo test
# Run specific test suites
cargo test --test websocket_config_tests
cargo test --test websocket_integration_tests
# e2e tests
cargo test --test e2e_tests -- --nocapture
RUST_LOG=debug cargo run --example basic_client
MIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.