A command-line tool that leverages multiple AI providers (Anthropic Claude, OpenAI, Mistral) to generate git commit messages, code reviews, and process text-based outputs. Built in Rust, aika-rs provides a seamless interface for interacting with AI models from your terminal.
- π€ Multiple AI provider support (Anthropic Claude, OpenAI, Mistral)
- π Generate AI-powered commit messages from git diffs
- π Code review generation with specialized Rust review support
- π List available models for each provider
- π§ Flexible input sources (files, directories, commands)
- π¬ Multiple prompt templates (commit messages, code reviews, README generation)
- π Support for streaming responses
- π¦ Text wrapping with paragraph support
- π― Debug mode for detailed execution information
- Rust toolchain (1.56 or later)
- API key for at least one supported provider:
- Anthropic API key (for Claude models)
- OpenAI API key (for GPT models)
- Mistral API key (for Mistral models)
- Git (for commit message generation)
git clone https://github.com/mycroft/aika-rs
cd aika-rs
cargo build --releaseThe binary will be available at target/release/aika
Create a configuration file at ~/.config/aika-rs/config.toml (or specify custom location with --config):
[credentials]
anthropic_api_key = "your_anthropic_api_key"
openai_api_key = "your_openai_api_key"
mistral_api_key = "your_mistral_api_key"
[providers.claude]
model = "claude-sonnet-3-latest"
[inputs.git-diff-cached]
command = "git diff --cached"
[inputs.git-diff]
command = "git diff"
[prompts.commit-message]
prompt = """
Generate a concise and descriptive git commit message for the following changes:
- Use conventional commit style (type: short summary)
- Start with a lowercase imperative verb
- Keep the summary under 72 characters
{input}
"""
[prompts.review]
prompt = "Review the following code changes and provide feedback on correctness, readability, security, and performance.\n\n{input}"
[prompts.review-rust]
prompt = "As a senior Rust engineer, review the following code changes with focus on idiomatic Rust, ownership/borrowing, and safety.\n\n{input}"See contrib/config.toml for a complete example configuration.
You can also set API keys via environment variables:
ANTHROPIC_API_KEY: Your Anthropic API keyOPENAI_API_KEY: Your OpenAI API keyMISTRAL_API_KEY: Your Mistral API key
# List models for default provider (Claude)
aika list-models
# List models for specific provider
aika list-models --provider openai
aika list-models --provider mistral# Using staged changes
aika query
# Using specific files
aika query --input "file:src/main.rs,README.md"
# Using a directory
aika query --input "dir:src"
# Using a specific model
aika query --model "claude-3-5-opus-latest"
# Using a specific provider
aika query --provider openai
# Using a custom prompt
aika query --prompt "commit-message"# Review changes with default prompt
aika query --prompt review
# Rust-specific code review
aika query --prompt review-rust
# Review specific git diff
aika query --input "cmd:git diff HEAD~1" --prompt reviewEnable streaming for real-time responses:
aika query --streamAdd --debug flag to see detailed execution information:
aika query --debug- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- AI Provider APIs:
- Anthropic Claude API - Claude models
- OpenAI API - GPT models
- Mistral API - Mistral models
- clap - Command line argument parsing
- ureq - HTTP client
- serde - Serialization framework
- toml - Configuration file parsing
- Additional dependencies can be found in
Cargo.toml
This project is licensed under the MIT License - see the LICENSE file for details.