@aayush0821/commit-ai
v1.0.0
Published
AI powered Git workflow assistant that generates commits and creates PRs
Downloads
95
Maintainers
Readme
Commit-AI
AI-powered Git workflow assistant that generates intelligent commit messages, manages branches, pushes changes, and creates GitHub Pull Requests — all from your terminal.

Overview
Commit-AI is a developer productivity CLI tool that automates the repetitive parts of the Git workflow.
Instead of manually:
- checking your changes
- writing commit messages
- creating branches
- committing code
- pushing changes
- opening Pull Requests
Commit-AI turns the entire process into a single command:
commit-ai prIt analyzes your repository changes, understands your code diff using AI, generates a conventional commit message, prepares a PR description, safely handles branches, pushes your code, and creates a GitHub Pull Request.
Problem
Every Developer has faced this :
git status
git diff
"what should I name this commit?"
git add .
git commit -m "update"
git push
go to GitHub
create PR
write descriptionThe Git workflow is powerful, but repetitive. Commit-AI removes that friction.
Features
AI Commit Message Generation
Commit-AI analyzes your git diff and creates meaningful conventional commits.
Example :
Before :
git commit -m "changes"After :
feat(auth) : add jwt authentication middlewareSupported Formats :
feat
fix
chore
refactor
docs
testAI Generated Pull Request
- feat
- fix
- chore
- refactor
- docs
- test
Example :
Title:
feat(auth): add jwt authentication
Body:
## Summary
Added JWT based authentication flow.
## Changes
- Added token validation
- Added middleware
- Updated auth routes
## Risks
- Existing users need migrationSmart Branch Management
Commit-AI understands Git Branches.
- Use Current Branch
main- Switch Existing Branch
Example :
main
develop
feature/payment
feature/dashboardCommit-AI safely moves your changes.
- Create new Branch Automatically
Example :
fix/payment-validation
feat/user-authentication
refactor/api-layerGenerated from your changes.
One Command WorkFlow
The complete PR flow :
commit-ai prDoes :
Analyze repository
↓
Read git diff
↓
Generate AI commit
↓
Generate PR description
↓
Select branch
↓
Commit changes
↓
Push changes
↓
Create GitHub PRInstallation
Install globally using npm
npm install -g commit-aiVerify Installtion :
commit-ai --versionConfiguration
Before using commit-AI, initialize your setup.
Run :
commit-ai initYou will configure:
- GitHub repository access
- AI API key
Commands
1) commit-ai init
Initialize commit-ai Configuration.
Usage :
commit-ai initCreates Configuration :
~/.commit-ai/config.jsonStores :
- Github Token
- AI Settings
- Preferences
2) commit-ai status
Analyze Repository State.
Example :
commit-ai statusOutput :
Commit-AI Repository Analysis
Branch:
feature/auth
Status:
✔ Working directory clean
Files:
0 modified3) commit-ai commit
Generate an AI Commit Message.
Example :
commit-ai commitFlow :
Read diff
AI analyzes changes
Generate message
Confirm
CommitExample Output :
Generated:
feat(api): add user validation endpoint
Commit?4) commit-ai pr
The Main Command.
Example :
commit-ai prFull WorkFlow
✔ Repository detected
✔ Changes analyzed
✔ Commit generated
Where should PR be created?
1. Current branch
2. Existing branch
3. New branch
✔ Commit created
✔ Code pushed
✔ Pull Request created
GitHub URL:
https://github.com/user/repo/pull/10Architecture
Commit-AI is built with a modular Architecture.
src
├── ai
│ └── commitAI.ts
│
├── core
│ ├── diffAnalyzer.ts
│ ├── branchGenerator.ts
│ └── statusAnalyzer.ts
│
├── git
│ ├── actions.ts
│ ├── branch.ts
│ ├── diff.ts
│ └── remote.ts
│
├── github
│ ├── parser.ts
│ ├── pullRequest.ts
│ └── prGenerator.ts
│
└── workflow
├── prWorkflow.ts
└── branchManager.tsInternal WorkFlow
When running :
commit-ai prInternally :
1) Repository Detection
Reads :
git remote -vExtracts :
owner
repository2) Diff Analysis
Runs :
git diffAnalysis :
- changed files
- additions
- removals
- modifications
3) AI Processing
The diff is sent to AI.
AI Returns :
commit message
PR Title
PR Description4) Branch Handling
Commit-AI checks :
current branch
working tree status
available branchesThen safely switches or creates.
5) Git Execution
Runs :
git add .
git commit
git push6) Github API
Creates :
Pull Requestusing Github REST API.
Testing
Commit-AI uses :
- Vitest
- Unit Testing
Run Tests :
npm testCurrent Coverage :
✓ Commit message validation
✓ Diff analyzer
✓ Branch generatorTech Stack
Runtime
- Node.js
- TypeScript
Git Integration
- simple-git
CLI
- commander
- inquirer
- chalk
- ora
AI
- OpenRouter API
Github
- Octokit
Testing
- Vitest
Contributing
Contributions are Welcome.
Steps :
git clone https://github.com/Aayush-0821/commit-ai.git
npm install
npm run build
npm testCreate a Branch :
git checkout -b feature/new-featureMake Changes.
Create PR :
commit-ai prLicense
MIT License
Author
Built by Aayush Vats
