Skip to content

Repository files navigation

🚀 Git Commit Generator (git-msg)

DeepSeek AIGitHubRustAI

GitHubGitHub workflowsGitHub issuesGitHub pull requestsGitHub release (latest by date)

GitHub starsGitHub forks

English中文

🤖 Automatically generate high-quality Git commit messages powered by AI

✨ Features

  • 🔍 Automatically analyze staged Git changes

  • 📝 Generate semantic commit messages using DeepSeek AI

  • 🎨 Support for multiple commit message formats (Conventional, Bracketed, etc.)

  • ⚙️ Configurable AI model parameters

  • 🚀 Simple and easy-to-use command line interface

📋 Prerequisites

  • 💻 Rust and Cargo installed

  • 🔑 DeepSeek API key

  • 📦 Git

🛠️ Installation

From source

# Clone the repository
git clone https://github.com/Emin017/git-commit-generator.git
# Change to the project directorycd git-commit-generator
# Build the binary
cargo build --release
# Install the binary
cargo install --path .# Run the binary
git-msg --help

Using Nix

nix run github:Emin017/git-commit-generator#git-msg

⚙️ Configure DeepSeek API Key

Create a .env file in your project directory:

DEEPSEEK_API_KEY=your_api_key_here

🚀 Usage

# Add files to commit
git add .# Generate commit message
git-msg
# Use different commit format
git-msg --format conventional
# Use different model
git-msg --model deepseek-coder

💡 Available Options

OptionShortDescriptionDefault
--format-fCommit message formatconventional
--model-mDeepSeek modeldeepseek-chat

📝 Commit Message Formats

Supported formats include:

  • Conventional: feat: add new feature

  • Bracketed: [feat]: add new feature

  • Plain: add new feature

🔄 Workflow

graph TD
A[Start] --> B[Read Configuration]
B --> C[Get Staged Changes]
C --> D{Any Changes?}
D -->|Yes| E[Call DeepSeek API]
D -->|No| F[Show Error]
E --> G[Generate Commit Message]
G --> H[End]
F --> H
Loading

🛡️ License

This project is licensed under the Mulan PSL v2. You can find the full license text here.

🙏 Acknowledgments

Thanks to DeepSeek AI for providing powerful AI models and the Rust community for excellent development tools and libraries!

🤝 Contributions

Contributions are welcome! Feel free to submit Issues and Pull Requests!

About

An AI-Powered git commit message Generator, also known as git-msg.

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages