| Crates.io | kodegen_tools_git |
| lib.rs | kodegen_tools_git |
| version | 0.10.10 |
| created_at | 2025-10-29 01:21:30.559932+00 |
| updated_at | 2026-01-02 15:07:51.184268+00 |
| description | KODEGEN.ᴀɪ: Memory-efficient, Blazing-Fast, MCP tools for code generation agents. |
| homepage | https://kodegen.ai |
| repository | https://github.com/cyrup-ai/kodegen-tools-git |
| max_upload_size | |
| id | 1905910 |
| size | 4,534,353 |
Memory-efficient, blazing-fast Git operations for AI code generation agents via Model Context Protocol (MCP).
Part of the KODEGEN.ai ecosystem.
git_init - Initialize new repositoriesgit_open - Open existing repositoriesgit_clone - Clone remote repositoriesgit_discover - Discover repository from any pathgit_branch_create - Create new branchesgit_branch_delete - Delete branchesgit_branch_list - List all branchesgit_branch_rename - Rename branchesgit_add - Stage files for commitgit_commit - Create commits with full metadatagit_checkout - Switch branches or restore filesgit_log - View commit history with streaming supportgit_fetch - Fetch from remotesgit_merge - Merge branchesgit_worktree_add - Create linked worktreesgit_worktree_remove - Remove worktreesgit_worktree_list - List all worktreesgit_worktree_lock - Lock worktreesgit_worktree_unlock - Unlock worktreesgit_worktree_prune - Prune stale worktreesAdd to your Cargo.toml:
[dependencies]
kodegen_tools_git = "0.1"
use kodegen_tools_git::{open_repo, CommitOpts, Signature};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Open a repository
let repo = open_repo("/path/to/repo").await??;
// Create a commit with builder pattern
let commit_id = kodegen_tools_git::commit(
repo,
CommitOpts::message("feat: add new feature")
.all(true)
.author(Signature::new("Your Name", "you@example.com"))
).await?;
println!("Created commit: {}", commit_id);
Ok(())
}
The binary runs an HTTP server exposing all Git tools via MCP:
cargo run --bin kodegen-git
The server typically runs on port 30450 and is managed by the kodegend daemon.
Connect via MCP client:
use kodegen_mcp_client::tools;
use serde_json::json;
// Call git_commit tool
let result = client.call_tool(
tools::GIT_COMMIT,
json!({
"path": "/path/to/repo",
"message": "feat: add feature",
"all": true
})
).await?;
See the examples/ directory for comprehensive demonstrations:
# Run the full Git demo (20+ operations)
cargo run --example git_demo
# Run direct API usage example
cargo run --example direct_comprehensive
Operations Layer (src/operations/)
gixTools Layer (src/tools/)
Runtime Layer (src/runtime/)
The RepoHandle type provides cheap cloning for thread-safe repository access:
let repo = open_repo("/path/to/repo").await??;
let repo_clone = repo.clone(); // Cheap! Shares underlying data
This enables safe concurrent operations while maintaining the performance benefits of gix.
cargo build
# Run all tests
cargo test
# Run specific test
cargo test test_name
# Run with output
cargo test -- --nocapture
cargo clippy --no-deps
Built on gix (Gitoxide), this library provides:
Contributions are welcome! Please ensure:
cargo testcargo fmtcargo clippyLicensed under either of:
at your option.
Built with ❤️ by KODEGEN.ai