AI-powered git commit messages using Google Gemini
Never write a commit message again.
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
Cancel# 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.
- Node.js v18 or higher
- A Google Gemini API key
brew tap asimar007/no-commit https://github.com/asimar007/no-commit
brew install nocommitnpm install -g nocommitVerify installation:
nocommit --version# Homebrew
brew upgrade nocommit
# npm
npm update -g nocommitStage your changes, then run nocommit:
git add <files...>
nocommit| 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 |
# Generate message for staged changes
nocommit
# Stage all changes and generate message
nocommit -a
# Stage all and commit without confirmation
nocommit --yesAfter 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
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-flash| 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) |
# 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=60000- 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
"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
Contributions are welcome! Check out the GitHub repository to report issues or submit pull requests.
- Asim Sk — @asimar007
This project is licensed under the MIT License - see the LICENSE file for details.
