| Crates.io | commitaura |
| lib.rs | commitaura |
| version | 1.3.0 |
| created_at | 2024-09-20 09:05:02.472246+00 |
| updated_at | 2025-05-21 00:53:51.305373+00 |
| description | Intelligent Git commit assistant with README integration |
| homepage | |
| repository | https://github.com/alexfigueroa-solutions/commitaura |
| max_upload_size | |
| id | 1381033 |
| size | 69,175 |
Intelligent, context-aware Git commit assistant powered by OpenAI and Rust
Commitaura is an intelligent Git commit assistant designed to streamline and enhance your commit workflow by leveraging the power of OpenAI's language models. It automatically generates concise, meaningful, and context-aware commit messages based on your staged changes and recent commit history. The tool is built in Rust for performance, reliability, and ease of integration into modern development environments.
Writing high-quality commit messages is a crucial part of software development. Good commit messages:
However, developers often struggle to write clear, specific, and consistent commit messages, especially when under time pressure. Commitaura solves this by:
This approach ensures that your commit history remains clean, informative, and professional, with minimal manual effort.
You can install Commitaura directly from crates.io:
cargo install commitaura
git clone https://github.com/alexfigueroa-solutions/commitaura.git
cd commitaura
.env file in the project root with your OpenAI API key:OPENAI_API_KEY=sk-...
cargo build --release
You can set your OpenAI API key as a global environment variable so it is available in all terminal sessions:
On Windows PowerShell:
[Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "sk-...", "User")
This will persist the key for your user account. Restart your terminal for changes to take effect.
On Linux/macOS (bash/zsh):
echo 'export OPENAI_API_KEY=sk-...' >> ~/.bashrc
# or for zsh
echo 'export OPENAI_API_KEY=sk-...' >> ~/.zshrc
source ~/.bashrc # or source ~/.zshrc
git add ....commitaura
cargo run --release
$ commitaura
Commit Changes
๐ Recent Commit Messages:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1. Refactor user authentication logic
2. Fix typo in README
3. Add logging to payment service
4. Update dependencies
5. Initial commit
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Generated commit message:
Improve error handling in payment processing
Do you want to proceed with this commit message? [Y/n]:
Commitaura uses cargo-release to automate versioning, changelog generation, and publishing.
cargo install cargo-release
cargo release patch
cargo release minor
cargo release major
Cargo.toml and Cargo.lockCHANGELOG.mdv1.2.3), GitHub Actions will:
See RELEASING.md for more details and examples.
Commitaura is written in Rust for its safety, speed, and excellent ecosystem. The project uses the following crates:
clap for command-line argument parsingconsole, colored, and indicatif for rich terminal UIdialoguer for interactive promptsopenai_api_rust for communicating with OpenAI's APItiktoken-rs for token counting and truncationdotenv and env_logger for environment and logging managementthiserror for ergonomic error handlingOpenAI models have strict token limits. Commitaura estimates the number of tokens in your prompt and diff, truncating the diff if necessary to ensure the request fits within the model's constraints. This is handled using the tiktoken-rs crate, which provides accurate tokenization compatible with OpenAI models.
All major operations are wrapped in robust error handling. Custom error types provide clear, actionable feedback for issues like missing API keys, no staged changes, or API failures.
The codebase is modular and easy to extend. You can add new subcommands, integrate with other LLM providers, or customize the prompt for different commit message styles.
Contributions are welcome! Please open issues or pull requests on GitHub. For major changes, open an issue first to discuss your ideas.
A: Make sure you have a .env file in your project root with OPENAI_API_KEY=sk-... set, or that the environment variable is set in your shell.
A: Make sure you have staged your changes with git add ... before running Commitaura. Only staged changes are considered.
A: Try re-running Commitaura, or review your staged changes and recent commit history. If the problem persists, check your OpenAI API quota.
A: Currently, the model is set in the source code. You can change the MODEL_NAME constant in src/main.rs to another supported model.
A: Set the RUST_LOG environment variable to debug or info before running Commitaura for more verbose output.
To run tests:
cargo test
To run with debug logging:
$env:RUST_LOG = "debug" # PowerShell
cargo run --release
To lint and check formatting:
cargo fmt -- --check
cargo clippy --all-targets --all-features -- -D warnings
For questions, bug reports, or feature requests, please open an issue on GitHub or contact the author.
MIT License. See LICENSE for details.
Commitaura is maintained by Alex Figueroa.
Commitaura: Let AI handle your commit messages, so you can focus on building great software.