| Crates.io | jules-rs |
| lib.rs | jules-rs |
| version | 0.1.0 |
| created_at | 2025-12-30 20:19:13.827587+00 |
| updated_at | 2025-12-30 20:19:13.827587+00 |
| description | Production-grade Rust client for the Jules API |
| homepage | https://github.com/babybirdprd/jules-rs |
| repository | https://github.com/babybirdprd/jules-rs |
| max_upload_size | |
| id | 2013243 |
| size | 76,994 |
A production-grade Rust client for the Jules API.
Jules is Google's AI coding agent that can understand, plan, and execute coding tasks on your GitHub repositories.
Add to your Cargo.toml:
[dependencies]
jules-rs = "0.1"
tokio = { version = "1", features = ["full"] }
futures-util = "0.3"
use jules_rs::{JulesClient, Session, SourceContext, GitHubRepoContext};
use futures_util::StreamExt;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = JulesClient::new("YOUR_OAUTH_TOKEN")?;
// List all sessions
let response = client.list_sessions(Some(10), None).await?;
for session in response.sessions {
println!("Session: {:?} - {:?}", session.id, session.title);
}
Ok(())
}
reqwest and futuresuse jules_rs::{JulesClient, Session, SourceContext, GitHubRepoContext};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = JulesClient::new("YOUR_OAUTH_TOKEN")?;
let session = Session {
name: None,
id: None,
prompt: "Refactor the error handling in the main module".to_string(),
source_context: SourceContext {
source: "sources/my-repo".to_string(),
github_repo_context: Some(GitHubRepoContext {
starting_branch: "main".to_string(),
}),
},
title: Some("Refactor Task".to_string()),
require_plan_approval: Some(true),
automation_mode: None,
create_time: None,
update_time: None,
state: None,
url: None,
outputs: None,
};
let created = client.create_session(&session).await?;
println!("Created session: {}", created.name.unwrap());
Ok(())
}
use jules_rs::JulesClient;
use futures_util::StreamExt;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = JulesClient::new("YOUR_OAUTH_TOKEN")?;
let mut stream = client.stream_sessions();
while let Some(result) = stream.next().await {
let session = result?;
println!("Session: {:?} - State: {:?}", session.title, session.state);
}
Ok(())
}
use jules_rs::JulesClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = JulesClient::new("YOUR_OAUTH_TOKEN")?;
// When a session is in AWAITING_PLAN_APPROVAL state
client.approve_plan("sessions/abc123").await?;
Ok(())
}
JulesClient::new(api_key)| Endpoint | Method | Status |
|---|---|---|
| Sessions | Create | ✅ |
| Sessions | Get | ✅ |
| Sessions | List | ✅ |
| Sessions | Delete | ✅ |
| Sessions | Stream | ✅ |
| Sessions | Send Message | ✅ |
| Sessions | Approve Plan | ✅ |
| Activities | Get | ✅ |
| Activities | List | ✅ |
| Sources | Get | ✅ |
| Sources | List | ✅ |
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.