aicom
v0.6.0
Published
AI git commit - see message, press Enter, commit
Maintainers
Readme
🤖 AIcom - AI-Powered Git Commit
One command to commit with AI-generated message. No prompts, no copy-paste, just commit.
🚀 Quick Start
Installation
npm install -g aicom
# or
pnpm add -g aicomSetup
Get a free API key from OpenRouter and set it:
export OPENROUTER_API_KEY=your_key_here
# The tool will store this key in ~/.aicom/config.json automatically
# Add to ~/.zshrc or ~/.bashrc if you prefer keeping it in your shell tooThe API key will be automatically saved to ~/.aicom/config.json for future use.
Usage
git add .
aicomThat's it! AI generates the commit message and commits automatically.
📝 Example
$ git add src/auth.ts
$ aicom
git commit -m "feat: add JWT authentication to user service" (Press Enter to commit)
# [User presses Enter]
[main abc1234] feat: add JWT authentication to user service
1 file changed, 45 insertions(+), 3 deletions(-)Simple: See the message, press Enter, done!
🎯 How It Works
- Checks Git Status - Verifies you're in a git repo with staged changes
- Fetches Free Model - Automatically finds an available free model from OpenRouter
- Analyzes Changes - Gets the git diff of your staged changes
- Generates Message - Uses AI to create a conventional commit message
- Outputs Command - Displays the ready-to-run git commit command
🔧 Features
- ✅ One command commit - Just run
aicom, press Enter, done - ✅ Shows the commit message before executing
- ✅ AI-generated messages using free OpenRouter models
- ✅ Conventional commit format (feat:, fix:, docs:, etc.)
- ✅ Analyzes git diffs for context
- ✅ Zero configuration needed (just API key)
- ✅ Press Enter to confirm
- ✅ Zero runtime dependencies
- ✅ Small package size (~6.7 kB)
🛠️ Development
Local Development
# Clone the repository
git clone https://github.com/yourusername/aicom.git
cd aicom
# Install dependencies
npm install
# Build
npm run build
# Test locally
npm run devBuild for Production
npm run buildPublishing
# Login to npm
npm login
# Publish
npm publish
# or with pnpm
pnpm publish📦 Configuration
API keys can be provided in two ways:
- Environment variable:
OPENROUTER_API_KEY. When present,aicomsaves it to~/.aicom/config.jsonso future sessions can reuse it automatically. - Config file:
~/.aicom/config.json. You can edit this file directly if you need to rotate keys or switch accounts.
💡 Tips
- The API key is automatically saved after first use - no need to export it every time
- Optionally add
export OPENROUTER_API_KEY=your_keyto~/.zshrcor~/.bashrcif you prefer - The tool automatically uses free models from OpenRouter
- Follows conventional commit best practices
- Works silently - only shows git's commit output
- If you need to edit before committing, use
git commit --amend
🤝 Contributing
This is a simple starter project. Feel free to:
- Implement streaming responses
- Create better UI components
- Add custom templates
- Improve error handling
- Add commit message history
📄 License
MIT
