patchwise
v1.2.0
Published
AI-assisted Git commits, with the developer still in charge.
Downloads
379
Maintainers
Readme
Patchwise
AI-assisted Git commits, with you still in charge.
Patchwise is a CLI tool that helps developers turn raw Git changes into clean, structured, and meaningful commits using AI assistance.
It analyzes your diff, suggests commit messages with detailed bodies, and guides you through staging and committing while keeping you fully in control.
Features
- Analyze staged or unstaged changes
- Generate commit messages with body using AI
- Supports Conventional Commits
- Interactive file selection and staging
- Live Groq model selection during setup
- Custom commit message option
- Optional push after commit
- Smart diff truncation for large changesets
- Colorful CLI output with type badges
- Multi-language support (EN / FR)
- Provider-agnostic architecture, Groq by default
Installation
npm install -g patchwiseor
pnpm add -g patchwiseQuick Start
1. Run setup
patchwise setupThis interactive wizard will:
- Ask for your Groq API key (get one at console.groq.com/keys)
- Let you pick a model from the live list of available Groq models
- Set your preferred commit language
Or set your API key manually:
export GROQ_API_KEY=your_api_key_here2. Stage your changes
git add .3. Generate and commit
patchwise commitExample
patchwise commit────────────────────────────────────────────────
📝 Commit Suggestions
────────────────────────────────────────────────
Summary:
Update project configuration and add payment documentation
Suggestions:
1. [CHORE] chore(config): update gitignore and add payment docs
- Add .gitignore entries for build artifacts
- Document Genuka Pay integration flow
2. [DOCS] docs: add payment docs and update gitignore
- Document payment module structure
- Ignore generated config files
────────────────────────────────────────────────Commands
patchwise commit
Generate suggestions and create a commit from staged changes.
patchwise commitOptions:
--allstage all changes before commit--selectinteractively select files--pushpush after commit--yesskip confirmations--lang <en|fr>commit language--provider <name>AI provider--model <model>AI model--scope <scope>set commit scope--no-scopedisable scope
patchwise suggest
Generate commit suggestions without committing.
patchwise suggestpatchwise stage
Interactively select files to stage.
patchwise stagepatchwise setup
Run the interactive setup wizard to configure your AI provider, model, and API key.
patchwise setuppatchwise config init
Create a project config file.
patchwise config initConfiguration
Environment variables
GROQ_API_KEY=xxx
PATCHWISE_PROVIDER=groq
PATCHWISE_MODEL=llama-3.3-70b-versatile
PATCHWISE_LANGUAGE=enConfig file
Create patchwise.config.json:
{
"provider": "groq",
"model": "llama-3.3-70b-versatile",
"commitConvention": "conventional",
"language": "en",
"maxSubjectLength": 72,
"confirmBeforeCommit": true,
"confirmBeforePush": true,
"scopeStrategy": "auto"
}scopeStrategy
Controls how commit scopes are handled:
"auto"— AI infers the scope from the diff (default)"manual"— you provide a scope via--scope"none"— no scope is included in commit messages
Conventional Commits
Patchwise generates commits following this format:
type(scope): subject
body (optional)Supported types: feat, fix, refactor, docs, test, chore, perf, build, ci
Examples:
feat(auth): add email verification flow
fix(api): handle null company id
refactor(ui): simplify sidebar logic
docs(readme): update installation guide
chore(config): update gitignore and add payment docs
- Add .gitignore entries for build artifacts
- Document Genuka Pay integration flowAI Providers
Supported:
- Groq (with live model selection)
Planned:
- OpenAI
- Ollama
- Anthropic
Architecture
CLI
├── Git Layer
├── AI Layer (provider-agnostic)
├── Commit Engine (diff, format, truncation)
├── Config System (env + project + user)
└── UI Layer (colors, prompts, output)Safety
- No commit without user validation
- No push without confirmation unless explicitly requested
- API keys are not stored in the project
- Only staged changes are used by default
- Smart diff truncation prevents token limit errors
Development
Install dependencies:
pnpm installRun in development:
pnpm devBuild:
pnpm buildLint + typecheck:
pnpm check:ciTests:
pnpm testContributing
See CONTRIBUTING.md for details.
- open an issue
- submit a pull request
- improve documentation
- propose features
License
MIT
Philosophy
Patchwise does not replace Git.
It helps you write better commits, keep history clean, and move faster without losing control.
Support
If you find the project useful, consider starring the repository.
