A terminal-based UI (TUI) for reviewing git and mercurial changes with vim keybindings. Navigate diffs like vim, add comments inline, and persist them with code provenance for AI consumption.
- π Works with both Git and Mercurial (auto-detects)
- π¨ Colorized diff view (green for additions, red for deletions)
- β¨οΈ Vim-style keybindings for navigation
- π¬ Inline commenting with persistence
- π Search functionality
- π Comments stored with file path and line number context
Download the latest release for your platform from GitHub Releases:
# Download and install
curl -LO https://github.com/bobrenjc93/vr/releases/latest/download/vr-linux-x86_64
chmod +x vr-linux-x86_64
sudo mv vr-linux-x86_64 /usr/local/bin/vr
# Or install to user directory
mkdir -p ~/.local/bin
mv vr-linux-x86_64 ~/.local/bin/vr
# Add ~/.local/bin to PATH if not already therecurl -LO https://github.com/bobrenjc93/vr/releases/latest/download/vr-linux-aarch64
chmod +x vr-linux-aarch64
sudo mv vr-linux-aarch64 /usr/local/bin/vrcurl -LO https://github.com/bobrenjc93/vr/releases/latest/download/vr-macos-x86_64
chmod +x vr-macos-x86_64
sudo mv vr-macos-x86_64 /usr/local/bin/vrcurl -LO https://github.com/bobrenjc93/vr/releases/latest/download/vr-macos-aarch64
chmod +x vr-macos-aarch64
sudo mv vr-macos-aarch64 /usr/local/bin/vr# Download vr-windows-x86_64.exe from releases page
# Rename to vr.exe and add to PATH# Coming soon
brew install vrRequires Rust 1.70 or later.
# Clone the repository
git clone https://github.com/bobrenjc93/vr.git
cd vr
# Build and install
cargo install --path .
# Or build without installing
cargo build --release
# Binary will be at target/release/vrvr --version # Should work once we add --version flag
# Or just run vr in any git or mercurial repository
cd /path/to/repo
vrThe tool auto-detects whether you're in a git or mercurial repository.
# Review uncommitted changes
vr
# Review last commit
vr HEAD
# Review specific commit
vr abc123
# Review branch diff
vr main..feature# Review uncommitted changes
vr
# Review current changeset
vr .
# Review specific changeset
vr 123
# Review range of changesets
vr 100::110| Key | Action |
|---|---|
j / β |
Move cursor down |
k / β |
Move cursor up |
g |
Jump to top |
G |
Jump to bottom |
Ctrl+d |
Page down |
Ctrl+u |
Page up |
o / O |
Enter insert mode (add comment) |
d |
Delete comment at cursor |
/ |
Enter search mode |
n |
Next search match |
N |
Previous search match |
? |
Show help screen |
:wq |
Save comments and quit |
:w |
Save comments |
:q |
Save and quit |
:q! |
Quit without saving |
Ctrl+c |
Force quit |
| Key | Action |
|---|---|
ESC |
Save comment and exit to normal mode |
Enter |
Add new line (multi-line comments) |
Backspace |
Delete character |
| Any character | Type comment text |
| Key | Action |
|---|---|
Enter |
Execute search |
ESC |
Cancel search |
Backspace |
Delete character |
| Any character | Type search query |
Comments are saved to /tmp/vr/{uuid}.txt in plain text format:
src/main.rs:42
This function needs better error handling.
Consider using Result<T, E> instead of unwrap().
src/utils.rs:15
Add input validation here
Each comment includes:
- File path and line number on the first line (e.g.,
src/main.rs:42) - Comment text (can be multi-line)
- Blank line separator between comments
The file path is printed when you save with :wq.
- Make some changes to your code
- Run
vrto see the diff - Navigate to a line you want to comment on using
j/k - Press
oto enter insert mode - Type your comment (e.g., "AI: please add null check here")
- Press
Enterto add more lines if needed (multi-line comments supported!) - Press
ESCto exit insert mode - Navigate to other lines and add more comments as needed
- Press
:wqand Enter to save and quit - The file path will be printed (e.g.,
/tmp/vr/abc123.txt) - Comments are saved in plain text format with file paths and line numbers
The application is built with:
- ratatui: Terminal UI framework
- crossterm: Terminal input handling
- git2: Git repository operations
- serde: JSON serialization for comments
- uuid: Unique file naming
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone and build
git clone https://github.com/bobrenjc93/vr.git
cd vr
cargo build
# Run tests
cargo test
# Run with cargo
cargo run
# Format code
cargo fmt
# Lint
cargo clippyTo create a new release:
- Update version in
Cargo.toml - Create and push a git tag:
git tag -a v0.2.0 -m "Release v0.2.0" git push origin v0.2.0 - GitHub Actions will automatically build binaries for all platforms and create a release
- Add
--versionflag - Homebrew formula
- Support for custom output directory
- Comment editing (not just add/delete)
- Integration with GitHub PR comments
- Syntax highlighting for code (not just diff markers)
- Export to Markdown format
MIT