can-i-merge
v0.3.0
Published
AI-powered Git Review Pipeline with Intelligent Context Building
Readme
can-i-merge
Before you merge, ask one question.
can-i-merge?
AI-powered Git review pipeline with intelligent context building.
Why?
Most AI code review tools simply send your changed files to an LLM.
can-i-merge does something different.
Instead of asking:
"Which AI should I use?"
It asks:
"What is the best context I can give the AI?"
The AI is replaceable.
The Context Engine is the real product.
Features
- Git Diff analysis
- Intelligent Context Builder
- Context Budget Engine
- Dependency-aware context collection
- Multiple AI providers
- Claude
- OpenAI
- NVIDIA
- Gemini
- Ollama (local LLM)
- OpenRouter
- Custom (any OpenAI-compatible endpoint, including self-hosted/local LLM servers)
- Provider abstraction
- Encrypted local credential storage (
--api-key/--model/--base-url, saved for future runs) - GitHub Action (Planned)
- VSCode Extension (Planned)
- MCP Server (Planned)
- Review Memory (Planned)
Philosophy
Good AI reviews don't come from better models.
They come from better context.
Git Diff
│
▼
Context Engine
│
▼
Claude / GPT / Gemini / NVIDIA
│
▼
Normalized ReviewInstallation
npm install -g can-i-mergeUsage
Review current changes
can-i-mergeReview latest commit
can-i-merge --commit HEADDeep review
can-i-merge --level deepChoose AI provider
can-i-merge --provider claudeUse a local LLM (e.g. Ollama)
can-i-merge --provider ollama --model llama3.1Point at any custom OpenAI-compatible endpoint (self-hosted, local server, etc.)
can-i-merge --provider custom --base-url http://localhost:1234/v1 --model local-modelAPI key / model / base URL are saved encrypted under ~/.can-i-merge after the first run, so later runs don't need the flags again:
can-i-merge --provider openai --api-key sk-... --model gpt-4.1 # saved
can-i-merge --provider openai # reuses the saved key/model
can-i-merge --provider openai --forget-credentials # removes themSecurity review
can-i-merge --type securityJSON output
can-i-merge --jsonExample
$ can-i-merge
Analyzing Git Diff...
Building Context...
Reviewing with Claude...
────────────────────────────
Overall Score
92 / 100
Critical
0
High
1
Medium
2
Low
1
────────────────────────────
❌ Merge Status
NOT READY
────────────────────────────
High
src/auth/login.ts:48
JWT validation should happen after authorization.
Recommendation
Move authorization check before JWT validation.Architecture
Git Repository
│
▼
Git Analyzer
│
▼
Context Builder
┌──────────────────────────┐
│ Dependency Resolver │
│ Context Score Engine │
│ Context Budget Engine │
│ Prompt Builder │
│ Review Memory │
└──────────────────────────┘
│
▼
Provider Layer
┌──────────────────────────┐
│ Claude │
│ OpenAI │
│ NVIDIA │
│ Gemini │
│ Ollama │
│ OpenRouter │
│ Custom (any OpenAI- │
│ compatible endpoint) │
└──────────────────────────┘
│
▼
Normalizer
│
▼
ReviewResultWhy another AI review tool?
Most tools focus on the AI.
We focus on the context.
Instead of sending an entire repository to an LLM, can-i-merge builds the smallest, most relevant context possible.
That means:
- Lower cost
- Faster reviews
- Better answers
- Model independence
Roadmap
v0.1
- CLI
- Git Diff Analyzer
- Context Builder
- Claude Provider
- Terminal Reporter
v0.2
- Context Budget Engine
- Context Score Engine
- OpenAI Provider
- NVIDIA Provider
- Ollama Provider
v0.3
- Review Memory
- Incremental Review
- GitHub Action
- VSCode Extension
v1.0
- Multi AI Consensus
- MCP Server
- Dashboard
- Auto Fix
- Team Review
Contributing
Contributions are welcome.
If you have ideas for improving the Context Engine, please open an issue or submit a pull request.
License
MIT License
