Skip to main content

AI-powered Git merge conflict resolver

Project description

n0conflict

AI-powered Git merge conflict resolver.

CI PyPI Python License: MIT

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 commandsresolve, scan, and explain
  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

n0conflict-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

n0conflict-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file n0conflict-0.1.0.tar.gz.

File metadata

  • Download URL: n0conflict-0.1.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for n0conflict-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1956ddcf767e49b211d6d490ae2a19f22534889f0b6cfbb0a6bbf0965cb8b2d0
MD5 f42dff7077998fd484b8d2e461556730
BLAKE2b-256 b314170e029665dceb349b32b84378c94aa7acf5688c091c4deb9ef0ea9c25b3

See more details on using hashes here.

File details

Details for the file n0conflict-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: n0conflict-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for n0conflict-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 239111326b0c2d3bc1a86cb4cbba7dee12b3f17e375bf7f217803200efc747de
MD5 ccd0c700e7a26e95f49a81f7d0c18e3f
BLAKE2b-256 c210290a5c98f775a76b28c8b80a7a2bbdd007f6d6869a1d20f24d5fc494ed8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page