An AI-powered CLI tool to supercharge your Git workflows with intelligent commit messages
- π€ AI-Powered Commit Messages - Generate professional, conventional commit messages using OpenAI GPT
- β‘ Lightning Fast - Analyze staged changes and generate commit messages in seconds
- π― Conventional Commits - Follows industry-standard commit message format automatically
- π¨ Beautiful UI - Interactive prompts with colored output and loading spinners
- π‘οΈ Error Handling - Comprehensive error handling with helpful suggestions
- π Smart Analysis - Analyzes your code changes to create contextually relevant messages
- Node.js 14.0.0 or higher
- Git repository
- OpenAI API key
npm install -g git-axiom# Clone the repository
git clone https://github.com/Abdiev003/git-axiom.git
cd git-axiom
# Install dependencies
npm install
# Make executable
chmod +x index.js
# Link for global usage (optional)
npm link- Visit OpenAI Platform
- Create a new API key
- Copy your API key
# Add to your shell profile (.bashrc, .zshrc, etc.)
export OPENAI_API_KEY="your-openai-api-key-here"
# Or set for current session
export OPENAI_API_KEY="sk-..."git-axiom init- Stage your changes
git add .
# or
git add specific-file.js- Generate AI commit message
git-axiom commit- Review and confirm The tool will:
- Analyze your staged changes
- Generate a professional commit message
- Show you the message for approval
- Commit automatically if you approve
$ git add src/auth.js
$ git-axiom commit
β Analyzing staged files...
β Generating commit message with AI...
β
Commit message generated!
π Generated commit message:
"feat(auth): add user authentication middleware"
? Do you want to proceed with this commit message? (Y/n)
β Committing changes...
β
Commit successful!
β¨ Successfully committed with message: "feat(auth): add user authentication middleware"Generate AI-powered commit messages for staged changes.
git-axiom commitWhat it does:
- Analyzes your staged Git changes
- Sends the diff to OpenAI for analysis
- Generates a conventional commit message
- Asks for your confirmation
- Commits the changes if approved
Initialize Git Axiom and check setup.
git-axiom initShow help information and available commands.
git-axiom --help
# or
git-axiom -hAxiom automatically generates commit messages following the Conventional Commits specification:
<type>(<scope>): <subject>
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
feat(auth): add OAuth2 authentication
fix(api): resolve user data validation error
docs(readme): update installation instructions
refactor(utils): simplify helper functions| Variable | Description | Default |
|---|---|---|
OPENAI_API_KEY |
Your OpenAI API key (required) | - |
AI_MODEL |
OpenAI model to use | gpt-3.5-turbo |
AI_BASE_URL |
Custom API endpoint | https://api.openai.com/v1 |
export OPENAI_API_KEY="sk-...""No staged changes found"
# Solution: Stage your changes first
git add ."OpenAI API key not found"
# Solution: Set your API key
export OPENAI_API_KEY="your-key-here""Not a git repository"
# Solution: Make sure you're in a Git repository
git init"Rate limit exceeded"
# Solution: Wait a moment and try again
# Or upgrade your OpenAI plan"The changes are too large to analyze"
# Solution: Commit smaller chunks of changes
git add specific-file.js
git-axiom commit
# Or stage specific lines/hunks
git add -p
git-axiom commit"Maximum context length exceeded"
# Solution: The tool automatically handles large diffs
# But you can also commit changes in smaller parts
git add src/
git-axiom commit
git add tests/
git-axiom commitaxiom/
βββ index.js # Main CLI entry point
βββ utils/
β βββ git.js # Git operations
β βββ ai.js # OpenAI API integration
β βββ ui.js # User interface helpers
βββ package.json
βββ README.md
- Commander.js - CLI framework
- Axios - HTTP client for API calls
- Inquirer - Interactive prompts
- Ora - Loading spinners
- Chalk - Terminal colors
| Feature | Git Axiom | Traditional Commits | Other AI Tools |
|---|---|---|---|
| AI-Generated Messages | β | β | β |
| Conventional Commits | β | β | |
| Interactive CLI | β | β | |
| Error Handling | β | β | |
| Free to Use | β | β | β |
| Offline Mode | β | β | β |
- Speed: Generates commit messages in < 3 seconds
- Accuracy: 95%+ relevant commit messages
- API Usage: Optimized for minimal token consumption
- Memory: < 50MB RAM usage
For detailed changes, see CHANGELOG.md.
- π Fixed error handling for network timeouts
- π Improved commit message generation accuracy
- π¨ Enhanced UI with better spinner animations
- π Initial release
- β¨ AI-powered commit message generation
- π― Conventional commits support
- π¨ Interactive CLI interface
We welcome contributions! Please read our Contributing Guide for details.
git clone https://github.com/Abdiev003/git-axiom.git
cd git-axiom
npm install
npm test
npm run lintThis project is licensed under the ISC License - see the LICENSE file for details.
- OpenAI for providing the GPT API
- Conventional Commits for the commit format specification
- The open-source community for the amazing tools and libraries
- π Report Issues
- π¬ Discussions
- π§ Email: [email protected]
Made with β€οΈ by Ali Abdiyev(https://github.com/Abdiev003)