nocommit
v0.0.9
Published
AI-powered CLI that writes your git commit messages using Google Gemini. Never write a commit message again.
Maintainers
Readme
nocommit
AI-powered git commit messages using Google Gemini
Never write a commit message again.
Why nocommit?
Writing good commit messages takes time. nocommit analyzes your staged changes and generates meaningful, conventional commit messages in seconds using Google's Gemini AI.
$ git add .
$ nocommit
✨ Generated commit message:
feat: add user authentication with JWT tokens
? What would you like to do?
❯ Commit
Edit
Regenerate
CancelQuick Start
# Install (choose one)
npm install -g nocommit
brew tap asimar007/no-commit https://github.com/asimar007/no-commit
brew install nocommit
# Set your Gemini API key
nocommit config set GEMINI_API_KEY=your_api_key_here
# Stage changes and generate commit
git add .
nocommitGet your API key from Google AI Studio.
Requirements
- Node.js v18 or higher
- A Google Gemini API key
Installation
Using Homebrew (macOS/Linux)
brew tap asimar007/no-commit https://github.com/asimar007/no-commit
brew install nocommitUsing npm
npm install -g nocommitVerify installation:
nocommit --versionUpgrading
# Homebrew
brew upgrade nocommit
# npm
npm update -g nocommitUsage
Basic Usage
Stage your changes, then run nocommit:
git add <files...>
nocommitCommand Options
| Flag | Description |
| ------------ | ------------------------------------------- |
| -a, --all | Stage all tracked changes before generating |
| -y, --yes | Skip confirmation and commit immediately |
| -h, --help | Show help |
| --version | Show version number |
Examples
# Generate message for staged changes
nocommit
# Stage all changes and generate message
nocommit -a
# Stage all and commit without confirmation
nocommit --yesInteractive Menu
After generating a message, you'll see these options:
- Commit — Use the message and commit
- Edit — Modify the message before committing
- Regenerate — Get a new suggestion
- Cancel — Exit without committing
Configuration
Manage settings with nocommit config:
# View all settings
nocommit config get
# Get a specific value
nocommit config get model
# Set a value
nocommit config set model=gemini-2.0-flashAvailable Options
| Option | Default | Description |
| ---------------- | ------------------ | --------------------------------------- |
| GEMINI_API_KEY | — | Your Google Gemini API key (required) |
| model | gemini-2.5-flash | Gemini model to use |
| maxLength | 72 | Max commit message length (20–500) |
| timeout | 30000 | API timeout in ms (5000–120000) |
| generate | 3 | Number of suggestions to generate (1–5) |
Example Configuration
# Use a different model
nocommit config set model=gemini-2.0-flash
# Allow longer commit messages
nocommit config set maxLength=100
# Generate only one suggestion
nocommit config set generate=1
# Increase timeout for slow connections
nocommit config set timeout=60000How It Works
- Diff — nocommit runs
git diff --stagedto capture your changes - Analyze — Changes are sent to Google's Gemini AI
- Generate — Gemini returns commit message suggestions following conventional commit format
- Commit — You review, optionally edit, and commit
Troubleshooting
"No staged changes found"
Stage files first with git add <files> or use nocommit -a.
"API key not configured"
Set your key with nocommit config set GEMINI_API_KEY=your_key.
Request timeout
Increase timeout: nocommit config set timeout=60000
Contributing
Contributions are welcome! Check out the GitHub repository to report issues or submit pull requests.
Maintainers
- Asim Sk — @asimar007
License
This project is licensed under the MIT License - see the LICENSE file for details.
