n0conflict
AI-powered Git merge conflict resolver.
n0conflict resolves Git merge conflicts using AI. Instead of forcing one side over the other, it reads both versions of the conflicting code and produces a single output that preserves the intent of each. When a conflict truly cannot be resolved automatically, it tells you why.
Features
- Intelligent merging — understands the intent of both sides, not just the text
- Honest failures — explains clearly when a conflict cannot be auto-resolved
- Multi-language aware — detects Python, TypeScript, Go, Rust, and more
- Three commands —
resolve,scan, andexplain - Safe by default — never writes to disk unless you pass
--write
Installation
pip install n0conflict
Requires Python 3.10+.
Configuration
n0conflict uses the Anthropic API. Set your key in the environment before running:
export ANTHROPIC_API_KEY="sk-ant-..."
Alternatively, use N0CONFLICT_API_KEY if you prefer to keep it separate.
Usage
Resolve conflicts in a file
# Preview what the resolved file would look like
n0conflict resolve src/app.py --dry-run
# Write the resolved file in place
n0conflict resolve src/app.py --write
Scan a repository for conflicted files
n0conflict scan
n0conflict scan /path/to/repo
Inspect conflicts without resolving
n0conflict explain src/app.py
Other
n0conflict --version
n0conflict --help
Example
$ n0conflict resolve app.py --write
n0conflict — app.py
Found 2 conflict block(s)
✓ Conflict 1: Conflict resolved successfully.
✓ Conflict 2: Conflict resolved successfully.
✓ Written to app.py
When a conflict cannot be resolved:
✗ Conflict 1: cannot be resolved automatically
╭─ Why it can't be resolved ────────────────────────────────────────────────╮
│ Both sides remove the authentication middleware but replace it with │
│ incompatible implementations — one using JWT, the other using sessions. │
│ Keeping both would cause duplicate request handling. │
╰───────────────────────────────────────────────────────────────────────────╯
Contributing
Contributions are welcome. Please open an issue before submitting a pull request for large changes.
git clone https://github.com/nicolasjkennedy/n0conflict
cd n0conflict
pip install -e ".[dev]"
pytest
License
MIT
Metadata
Release files for n0conflict 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| n0conflict-1.0.0.tar.gz | 9.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| n0conflict-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.3 kB
Release files / n0conflict-1.0.0.tar.gz
| Download URL | n0conflict-1.0.0.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fac3054a306fb31f2faa38bd38a5fc1d9faa373ace4583a016626127be57d62
|
|
BLAKE2b-256 checksum How to use checksums |
df865777255fde825cff29b3770882dc5099db7375223144f42e5484407a87fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / n0conflict-1.0.0-py3-none-any.whl
| Download URL | n0conflict-1.0.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
723bfa142dbd66116c4dc20bf81944e3caa8a610e92e6819f79e446a0368eb94
|
|
BLAKE2b-256 checksum How to use checksums |
53cfeb2034d5cb78765b2ea23ec11c021934ad4dda7ce8c085254cba2a4adbf3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|