Thanks for your interest in contributing to Rusty GitClaw! Here's how to get started.
- Fork the repository
- Clone your fork:
git clone https://github.com/<your-username>/rusty-gitclaw.git cd rusty-gitclaw
- Build the project:
cargo build --workspace
- Run tests:
cargo test --workspace - Run clippy:
cargo clippy --workspace
- Create a feature branch from
main:git checkout -b feat/my-feature
- Make your changes
- Run
cargo build --workspaceto verify compilation - Run
cargo test --workspaceto ensure tests pass - Run
cargo clippy --workspacefor lint checks - Commit your changes with a clear message
- Push and open a pull request
rusty-gitclaw/
├── pi-ai/ # LLM provider abstraction
│ └── src/
│ ├── types.rs # Core types (Message, Content, Model, Usage)
│ ├── models.rs # Model registry (383 models, 8 providers)
│ ├── stream.rs # Streaming dispatcher
│ ├── providers/ # Anthropic, OpenAI, Google providers
│ └── ...
├── pi-agent-core/ # Agent loop engine
│ └── src/
│ ├── types.rs # AgentTool trait, AgentEvent enum
│ ├── agent_loop.rs # Core stream → tool → loop cycle
│ ├── agent.rs # Agent struct with prompt/subscribe/abort
│ └── ...
└── gitclaw/ # CLI + SDK + tools + voice
└── src/
├── main.rs # CLI with clap + REPL with rustyline
├── sdk.rs # query() function
├── loader.rs # Agent manifest loading
├── tools/ # Built-in tools (cli, read, write, memory)
├── voice/ # OpenAI Realtime WebSocket adapter
└── ...
- Rust stable — target the latest stable Rust toolchain
- No unsafe — avoid
unsafeunless absolutely necessary and well-documented - Keep it simple — avoid over-engineering; match the TypeScript version's behavior
- Test your changes — add unit tests for new functionality
- One concern per PR — keep pull requests focused and reviewable
- Clippy clean —
cargo clippy --workspaceshould pass without warnings for new code
Use clear, descriptive commit messages:
Add streaming support for Mistral providerFix memory tool path resolution on WindowsUpdate agent loop to respect max_turns constraint
This is a pure translation of the TypeScript GitClaw. When in doubt about behavior, refer to the TypeScript implementation. Key translation patterns:
| TypeScript | Rust |
|---|---|
AsyncGenerator<T> |
mpsc::UnboundedReceiver<T> |
EventStream (push/end) |
mpsc::unbounded_channel + oneshot |
AbortSignal |
CancellationToken (tokio-util) |
interface AgentTool |
#[async_trait] trait AgentTool |
child_process.spawn |
tokio::process::Command |
fs/promises |
tokio::fs |
- Create
pi-ai/src/providers/your_provider.rs - Implement the
ApiProvidertrait - Register it in
pi-ai/src/providers/mod.rs - Add models to
pi-ai/data/models.json - Add the API key mapping in
pi-ai/src/env_api_keys.rs
- Search existing issues before opening a new one
- Include reproduction steps, expected vs actual behavior
- Include your Rust version (
rustc --version) and OS
Be respectful and constructive. We're all here to build something useful together.
By contributing, you agree that your contributions will be licensed under the MIT License.