Project Overview
Git AI CLI is a powerful AI-driven Git assistant that intelligently generates commit messages, analyzes code changes, and automatically generates project reports. The latest v2.0.0 version is rewritten in Rust, offering better performance and stability.
π Quick Start
Installation
npm install -g @dongowu/git-ai-cli
Basic Usage
# Initialize configuration
git-ai config
# Generate commit messages
git add .
git-ai
β¨ Core Features
π€ AI-Powered Commits
- Automatically analyzes code changes to generate professional commit messages
- Supports multiple AI models (DeepSeek, Ollama, OpenAI, etc.)
- Intelligently learns project commit styles
π‘οΈ Copilot Guardian Mode
git-ai --copilot
- Deep code impact analysis
- Risk detection and testing recommendations
- Change impact scope assessment
π Smart Reporting
# Generate weekly reports
git-ai report
# Generate release notes based on tags
git-ai report --from-last-tag
git-ai report --from-tag v1.0.0 --to-ref v2.0.0
βοΈ Engineering Configuration
Supports project-level configuration file .git-ai.json:
{
"provider": "deepseek",
"model": "deepseek-chat",
"locale": "en",
"enableFooter": true
}
π― Use Cases
Daily Development
git add .
git-ai --copilot
Team Collaboration
# Install Git Hook for seamless integration
git-ai hook install --global
Version Releases
# Generate version change descriptions
git-ai report --from-tag v1.0.0 --to-ref v2.0.0
π§ Advanced Features
Agent Intelligence
git-ai -a --copilot
- Smart handling of large files
- Code impact scope analysis
- Potential risk detection
Multi-Platform Support
- Automatic download of platform-specific binaries
- Supports Windows, macOS, Linux
- Local model privacy protection
π Command Reference
| Command | Description |
|---|---|
git-ai |
Interactive commit |
git-ai --copilot |
Copilot guardian mode |
git-ai -a |
Agent mode |
git-ai report |
Generate reports |
git-ai hook install |
Install Git Hook |
git-ai config |
Configuration management |
git-ai -n 3 |
Generate 3 candidate messages |
git-ai -y |
Skip confirmation and commit directly |
π Key Benefits
π Performance Optimized
- Rust-based core for faster execution
- Reduced memory footprint
- Quick startup time
π Privacy First
- Local model support (Ollama)
- Data never leaves your network
- Configurable privacy settings
π§ Context Aware
- Branch name analysis for relevant commit messages
- Learning from recent commit history
- Project-specific style adaptation
π§ Developer Friendly
- Seamless Git integration
- Zero-configuration setup for local models
- Comprehensive error handling
π οΈ Supported AI Models
| Category | Providers | Key Features | Configuration |
|---|---|---|---|
| Local Privacy | Ollama | Free, offline, absolute privacy | Auto-detection |
| LM Studio | Good compatibility | Manual URL input | |
| High-Speed Domestic | DeepSeek | Best value, excellent coding capability | API Key |
| Tongyi Qianwen | Alibaba ecosystem, strong long-text support | API Key | |
| Zhipu/Moonshot | Leading domestic models | API Key | |
| International | OpenAI | GPT-4o benchmark capability | API Key |
π Configuration Files
.git-ai.json (Project Configuration)
{
"provider": "deepseek",
"baseUrl": "https://api.deepseek.com/v1",
"model": "deepseek-reasoner",
"agentModel": "deepseek-chat",
"locale": "en",
"enableFooter": true
}
.git-aiignore (File Ignore Patterns)
package-lock.json
dist/
*.min.js
*.map
π Git Hook Integration
Automatic Setup
# Project-specific installation
git-ai hook install
# Global installation (all projects)
git-ai hook install --global
Usage with Hooks
git checkout -b feature/awesome-login
# ... write code ...
git add .
git commit # AI automatically generates: "feat(login): implement awesome login logic"
π Troubleshooting
Common Issues
1) 401 / API Key Invalid
git-ai config get --json --local
Check environment variables: GIT_AI_API_KEY, DEEPSEEK_API_KEY, OPENAI_API_KEY
2) Diff Truncation
- Use
.git-aiignoreto exclude large files - Set
GIT_AI_MAX_DIFF_CHARSenvironment variable
3) Agent Fallback to Basic Mode
GIT_AI_DEBUG=1 git-ai -a
π Version 2.0.0 Highlights
Technical Improvements
- Rust Migration: From Node.js/TypeScript to Rust for better performance
- Automated Releases: Tag-driven CI/CD pipeline
- Cross-Platform: Multi-architecture binary distribution
New Features
- Tag-range release description support
- Enhanced Copilot CLI integration
- Improved error handling and debugging
π Links
- GitHub Repository: https://github.com/dongowu/git-ai-cli
- npm Package: https://www.npmjs.com/package/@dongowu/git-ai-cli
π License
Apache 2.0 License
*Enhance your development workflow with AI-powered commit automation and intelligent code analysis
Top comments (0)