Terminal diff viewer with inline review comments
Project description
nit
Terminal diff viewer with inline review comments.
Navigate diffs with vim-style keybindings, leave comments on specific lines, and persist them as structured JSON. Useful for code review workflows, self-review before committing, and giving feedback to AI coding tools.
Install
pip install nit-cli
Usage
# Review current branch changes (vs main/master)
nit
# Review unstaged changes
nit --mode unstaged
# Review all uncommitted changes
nit --mode all
# Review a specific commit range
nit HEAD~3..HEAD
nit main..feature
# Filter to specific files or directories
nit --path src/
nit --path src/nit/app.py main..feature
Keybindings
| Key | Action |
|---|---|
j / k |
Move cursor down / up |
J / K |
Jump to next / previous hunk |
n / p |
Next / previous file |
] / [ |
Jump to next / previous comment |
c |
Add comment on current line |
d |
Delete comment on current line |
m |
Cycle diff mode (branch / unstaged / all) |
r |
Refresh diff |
q |
Quit |
Comment Storage
Comments are saved to .nit.json at the root of your git repository. The format is structured JSON:
{
"version": 1,
"branch": "my-feature",
"base": "main",
"comments": [
{
"file": "src/app.py",
"line": 42,
"line_content": " return result",
"comment": "Should handle the empty case here",
"hunk_context": ["...", "..."],
"timestamp": "2025-01-15T10:30:00+00:00",
"diff_mode": "branch"
}
]
}
Add .nit.json to your global gitignore to keep comments local:
echo '.nit.json' >> ~/.config/git/ignore
Claude Code Integration
nit works as a review tool for Claude Code. Leave comments on Claude's changes using nit, then have Claude read them with the /review-feedback skill. This creates a feedback loop where you can guide Claude's work through inline code review.
Development
git clone https://github.com/joshuazd/nit.git
cd nit
pip install -e ".[dev]"
pytest
The ./nit bootstrap script auto-creates a virtualenv for quick local use without manual setup.
License
GPL-3.0 - see LICENSE for details.
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 nit_cli-0.2.0.tar.gz.
File metadata
- Download URL: nit_cli-0.2.0.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdd8b4c7b672a78f2746537c19212aab31dbef85d64d02ede2e27966a5cd808c
|
|
| MD5 |
5fb28b5a03997ad48d2f0f2b7e7ab9a9
|
|
| BLAKE2b-256 |
d4d1003f5e2d67d2517415876508e561ad349036e33069df8cf76fa41e7c6828
|
Provenance
The following attestation bundles were made for nit_cli-0.2.0.tar.gz:
Publisher:
publish.yml on joshuazd/nit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nit_cli-0.2.0.tar.gz -
Subject digest:
fdd8b4c7b672a78f2746537c19212aab31dbef85d64d02ede2e27966a5cd808c - Sigstore transparency entry: 1191954676
- Sigstore integration time:
-
Permalink:
joshuazd/nit@449fe15f764a59cad8202a339dd78885a3be0461 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/joshuazd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@449fe15f764a59cad8202a339dd78885a3be0461 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nit_cli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nit_cli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9ee5721dff7134b79f81994d07eba2533985a11356cfb335e342ccffb970869
|
|
| MD5 |
4e6a38770cd40d4c59ad971df57545e3
|
|
| BLAKE2b-256 |
dbfc01e056f8d6cbd0aba8f9f75cf2e09f49d81e9524ae217a62eff7a60ee556
|
Provenance
The following attestation bundles were made for nit_cli-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on joshuazd/nit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nit_cli-0.2.0-py3-none-any.whl -
Subject digest:
b9ee5721dff7134b79f81994d07eba2533985a11356cfb335e342ccffb970869 - Sigstore transparency entry: 1191954680
- Sigstore integration time:
-
Permalink:
joshuazd/nit@449fe15f764a59cad8202a339dd78885a3be0461 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/joshuazd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@449fe15f764a59cad8202a339dd78885a3be0461 -
Trigger Event:
release
-
Statement type: