Read-only AI code review for your branch, right in your terminal, before you merge.
Project description
mergesentry
Read-only AI code review, right in your terminal, before you merge.
Compares your feature branch against main/develop using a read-only
Personal Access Token (GitHub or GitLab — your choice), sends the diff to
an LLM of your choice (Claude, GPT, or any OpenAI-compatible enterprise
endpoint), and prints a plain-language safety verdict. Nothing is ever
written back to GitHub/GitLab — no comments, no labels, no status checks.
Just you, your terminal, and a second opinion before you open the MR.
Why read-only
A write-capable token can post comments, change labels, or (if misconfigured) worse. mergesentry never needs any of that — it only reads diffs and prints to your terminal — so it only ever asks for the smallest possible permission. Nothing it does can modify your repo or your remote.
Install
pip install mergesentry
(Not on PyPI yet? Install locally from source: pip install -e . from
this project's root.)
Setup
cd your-project
mergesentry init
You'll be asked for:
- Git host (
githuborgitlab) - Repo, e.g.
myorg/myproject - Base branch to compare against (default
main) - LLM provider (
anthropic,openai, orcustomfor an enterprise gateway)
This creates a .mergesentry.yml in your repo — safe to commit, contains
no secrets.
Then set your credentials as environment variables (never commit these):
export GIT_TOKEN=your_read_only_personal_access_token
export LLM_API_KEY=your_llm_api_key
Getting a read-only token
GitHub: Settings → Developer settings → Personal access tokens → Fine-grained tokens → grant Contents: Read-only on the repo, nothing else.
GitLab: Project → Settings → Access Tokens → role Reporter,
scope read_api only.
Usage
git push origin feature/my-branch
mergesentry review
mergesentry — main → feature/my-branch
============================================================
⚠️ VERDICT: NEEDS_CHANGES
SUMMARY: Adds retry logic to the payment gateway call and reduces
the session timeout from 30 to 5 minutes.
CONCERNS:
- Retry loop has no backoff cap — risk of hammering the gateway
under sustained failure.
- Session timeout change has no migration note.
RECOMMENDATION: Add a backoff ceiling before opening the MR.
============================================================
This is an AI-generated review — use judgment, verify before acting.
Write access was never used: nothing was posted or changed on the remote.
Using an enterprise LLM gateway (e.g. company-provisioned Claude/GPT)
Set llm_provider: custom and llm_endpoint: https://your-company-gateway/...
in .mergesentry.yml — mergesentry will POST to it using the standard
OpenAI chat/completions request shape. LLM_API_KEY still comes from your
environment, provisioned by your company, never hardcoded.
What this does NOT do
- Does not post MR/PR comments
- Does not set commit statuses or labels
- Does not block or approve merges
- Does not modify anything in your repo or on the remote
It's a second pair of eyes in your terminal — the decision is always yours.
Publishing this yourself
pip install build twine
python -m build
twine upload dist/*
You'll need a PyPI account and API token (pypi.org → Account settings →
API tokens). Double-check the name mergesentry is still free on PyPI
before you publish — verify at https://pypi.org/project/mergesentry/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mergesentry-0.1.0.tar.gz.
File metadata
- Download URL: mergesentry-0.1.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d30fd7812f357771f4185b5fcd901327b5f52921a30d707568946c38f6df70c2
|
|
| MD5 |
ab05e511840e3bfc59cf2a4aae4af3dd
|
|
| BLAKE2b-256 |
d0a68358cb1c12e962609b85e8217afb4e5b6fac315e3f080158929201e5b591
|
File details
Details for the file mergesentry-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mergesentry-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f301cceacb2e5ee80c4bc08869b40aab21a0d18be491b95fe72019b1331727cf
|
|
| MD5 |
4c64ae06c1091348196329692b798f8d
|
|
| BLAKE2b-256 |
948fee5e0107dc03bc009d5c18a33e42121cb1fda6629a16776558d72e2afc3a
|