A CLI tool to browse functions and interfaces modified in git diffs. Features semantic diff analysis (added/modified/removed), filtering, and an interactive TUI mode. Output is clickable in VS Code terminal.
cargo install git-gogglescargo install --git https://github.com/aashrayanand/git-gogglesgit clone https://github.com/aashrayanand/git-goggles
cd git-goggles
cargo install --path .# Last commit
git-goggles HEAD~1
# Last 5 commits
git-goggles HEAD~5..HEAD
# Changes since main
git-goggles main..HEAD
# Staged changes
git-goggles --staged
# Interactive TUI mode
git-goggles -i HEAD~1
# Show grouped by change type
git-goggles --format grouped HEAD~1
# Show statistics
git-goggles --stats HEAD~1
# Filter by kind
git-goggles --kind functions HEAD~1
git-goggles --kind added HEAD~1
# Filter by file pattern
git-goggles --pattern "page_cache" HEAD~1
# JSON output for scripting
git-goggles --format json HEAD~1
# Specify repository path
git-goggles -C /path/to/repo HEAD~1+ /path/to/project/src/page_cache.rs:940: fn find_page_at_or_above_lsn
~ /path/to/project/src/page_cache.rs:1524: fn get_page_for_dirty_writer
- /path/to/project/src/writer.rs:137: enum RangePayload
+ /path/to/project/src/writer.rs:1995: fn build_payload_for_request_range
━━━ Added ━━━
+ /path/to/project/src/page_cache.rs:940: fn find_page_at_or_above_lsn
+ /path/to/project/src/writer.rs:1995: fn build_payload_for_request_range
━━━ Modified ━━━
~ /path/to/project/src/page_cache.rs:1524: fn get_page_for_dirty_writer
━━━ Removed ━━━
- /path/to/project/src/writer.rs:137: enum RangePayload
━━━ Statistics ━━━
+14 added | ~3 modified | -2 removed
11 functions | 6 types | 5 files
Press -i to launch the interactive terminal UI:
- Navigation:
j/kor arrow keys to move - Filter by change:
a(added),m(modified),r(removed) - Filter by kind:
f(functions),t(types) - Select:
Enterto print the file path - Quit:
qorEsc
Ctrl+click (or Cmd+click on Mac) on any line in VS Code terminal to jump directly to that function!
- Rust:
fn,impl,struct,enum,trait - Python:
def,class - Go:
func - JavaScript/TypeScript:
function
Add to your shell config for convenience:
alias goggles="git-goggles"
alias gog="git-goggles"MIT