@mrskjha/gitpush
v1.0.1
Published
AI-powered CLI that automatically generates git commit messages and pushes your changes using Gemini AI.
Maintainers
Readme
gitpush
Stop writing commit messages. Let AI do it.
The Problem
Every developer writes this dozens of times a day:
git add .
git commit -m "fix stuff"
git pushLazy commit messages make your git history useless. Good commit messages take time and mental energy you'd rather spend on actual code.
The Solution
gitpushOne command. AI analyzes your actual code changes and writes a meaningful commit message following Conventional Commits format — automatically.
Demo
$ gitpush
Suggested commit message:
feat(auth): add JWT validation middleware
? Use this commit message?
❯ Use this message
Edit message
Regenerate message
Cancel
[master abc1234] feat(auth): add JWT validation middleware
3 files changed, 47 insertions(+), 2 deletions(-)
✔ Pushed to origin/main
abc1234 — feat(auth): add JWT validation middlewareInstall
npm install -g @mrskjha/gitpushRequirements
- Node.js >= 18
- Git installed and configured
- Free Gemini API key
First Time Setup
On first run, the CLI will automatically ask for your Gemini API key:
No API key found.
? Enter your Gemini API key (get free key at aistudio.google.com): ________
✔ API key saved. You're all set!Get your free API key at → https://aistudio.google.com
Your key is stored locally at ~/.gitpush/config.json and never shared with anyone except the Gemini API.
Usage
Navigate to any Git repository and run:
gitpushThat's it. The CLI handles everything else.
What happens under the hood
your changes
↓
git add . (auto staging)
↓
git diff --staged (reads actual changes)
↓
Gemini AI (analyzes diff)
↓
commit message generated
↓
your confirmation
↓
git commit + git pushInteractive Options
After the AI generates a commit message, you get 4 choices:
| Option | What it does | |--------|-------------| | Use this message | Commits and pushes immediately | | Edit message | Opens the message for manual editing | | Regenerate message | Asks Gemini AI for a new message | | Cancel | Exits without committing |
Commands
| Command | Description |
|---------|-------------|
| gitpush | Stage, generate commit message, commit and push |
| gitpush --help | Show all available commands |
| gitpush --version | Show current version |
Commit Message Format
All generated messages follow the Conventional Commits standard:
type(scope): descriptionTypes used:
| Type | When |
|------|------|
| feat | New feature added |
| fix | Bug fixed |
| docs | Documentation changes |
| refactor | Code restructured |
| chore | Maintenance tasks |
| test | Tests added or updated |
| perf | Performance improvements |
Examples of generated messages:
feat(auth): add user login with JWT
fix(api): handle null response from payment gateway
refactor(dashboard): extract chart component
docs(readme): add installation instructionsPrivacy & Security
- Your code diff is sent to Google Gemini API to generate commit messages
- Your API key is stored locally at
~/.gitpush/config.json - Nothing is stored on any external server
- You can review exactly what gets sent — it's just your
git diff --stagedoutput
How It Works
- Checks you're inside a valid Git repository
- Stages all modified files with
git add . - Reads the staged diff with
git diff --staged - Sends the diff to Gemini AI with a carefully engineered prompt
- Gemini returns a commit message following Conventional Commits format
- You confirm, edit, or regenerate the message
- Runs
git commit -m "message"andgit push
Tech Stack
- TypeScript — fully typed codebase
- Commander — CLI argument parsing
- Inquirer — interactive terminal prompts
- Gemini AI — commit message generation
- tsup — fast TypeScript bundler
Roadmap
- [ ]
--no-pushflag — commit without pushing - [ ]
--no-aiflag — manual commit message, no API call - [ ] Branch detection in success message
- [ ] Secret scanner — warn before committing API keys
- [ ] Commit message history
- [ ] Config command —
gitpush config --reset - [ ] Support for multiple AI providers
Contributing
Contributions are welcome!
- Fork the repository
- Create a feature branch:
git checkout -b feat/your-feature - Make your changes
- Submit a pull request
Please follow Conventional Commits format for your commit messages — you can use gitpush itself! 😄
Troubleshooting
gitpush command not found
npm install -g @mrskjha/gitpushAPI key not valid
Get a new free key at https://aistudio.google.com and update ~/.gitpush/config.json
fatal: No configured push destination
git remote add origin https://github.com/username/repo.git
git push -u origin mainNothing to commit
Make sure you have modified files in your project before running gitpush
License
ISC License — see LICENSE for details
Author
mrskjha
- Website: mrskjha.tech
- GitHub: @mrskjha
- npm: @mrskjha
