{"id":50706108,"url":"https://github.com/zemse/gitdiff-tui","last_synced_at":"2026-06-09T12:01:16.631Z","repository":{"id":358962413,"uuid":"1243895800","full_name":"zemse/gitdiff-tui","owner":"zemse","description":"github like diff viewer but in the terminal","archived":false,"fork":false,"pushed_at":"2026-05-28T01:59:41.000Z","size":2440,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-28T03:23:46.478Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zemse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-19T19:14:14.000Z","updated_at":"2026-05-28T01:59:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zemse/gitdiff-tui","commit_stats":null,"previous_names":["zemse/gitdiff-tui"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zemse/gitdiff-tui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemse%2Fgitdiff-tui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemse%2Fgitdiff-tui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemse%2Fgitdiff-tui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemse%2Fgitdiff-tui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zemse","download_url":"https://codeload.github.com/zemse/gitdiff-tui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemse%2Fgitdiff-tui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34105565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-09T12:01:15.984Z","updated_at":"2026-06-09T12:01:16.614Z","avatar_url":"https://github.com/zemse.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gitdiff\n\nA Rust + ratatui TUI for reviewing local git changes like a GitHub PR — without\npushing or opening a PR. Comments are written to a `REVIEW.md` at the repo root,\nin a format a coding agent (or another human) can act on directly.\n\n![gitdiff TUI — comment thread with an agent reply](https://raw.githubusercontent.com/zemse/gitdiff-tui/main/screenshot.png)\n\n## Features\n\n- Auto-detects what to diff — working changes if dirty, else current branch vs.\n  the first trunk that exists, probed in order:\n  `upstream/main` → `upstream/master` → `origin/main` → `origin/master` →\n  local `main` → local `master`. (Fork workflows with `upstream` as the\n  canonical remote diff against canonical, not your fork's possibly-stale copy.)\n- Unified diff view with syntax highlighting (via `syntect`) and intra-line\n  word-level emphasis.\n- File tree sidebar (`e`), fuzzy file picker (`t`), per-file \"viewed\"\n  checkmark (`v`) that persists across runs.\n- Per-file and per-hunk collapse/expand, with `expand 20 above`/`below` buttons\n  to load more file context lazily.\n- Inline comments with a yellow-bordered composer: click a line (or press `c`)\n  to write markdown, click an existing comment to edit, `x` to delete.\n- Range comments via mouse drag or `V` (visual select), reactions (`K`),\n  resolve / unresolve (`r`).\n- Threads pane (`R`) listing every open comment; `S` submits all threads to\n  `REVIEW.md`. Threads auto-persist to `.gitdiff/threads.json`.\n- Review verdict (`V` cycles: comment / approve / request changes) shown in\n  the header bar.\n- Whitespace toggle (`w`), context-line +/- (`=` / `-`), tab width (`,` / `.`).\n- Yank current file path (`y`).\n- Mouse-driven everywhere: click to move, click headers to collapse, wheel\n  to scroll.\n- `ctrl-c` exits from anywhere, including the composer.\n\n## Install\n\n```sh\ncargo install gitdiff\n```\n\nOr from source:\n\n```sh\ngit clone https://github.com/zemse/gitdiff-tui\ncd gitdiff-tui\ncargo install --path .\n```\n\n## Use\n\nFrom any git repo:\n\n```sh\ngitdiff                  # auto-detects: working changes, else branch vs upstream\ngitdiff base..head       # explicit range\n```\n\n## CLI subcommands (for agents and scripting)\n\nThe same comment store the TUI uses is exposed as non-interactive subcommands\nso a coding agent (claude-code, codex, gemini, …) can read the diff, list\nthreads, post comments, reply, and resolve — without launching a terminal UI.\nEvery subcommand accepts an optional `\u003cbase\u003e..\u003chead\u003e` argument anywhere; if\nomitted, the same auto-detection as the TUI is used.\n\n```sh\ngitdiff diff [\u003crange\u003e]                     # print the unified diff to stdout\ngitdiff list [\u003crange\u003e] [--all] [--json]    # list open threads (--all incl. resolved)\ngitdiff show \u003ctid\u003e [\u003crange\u003e] [--json]      # print one thread with replies\ngitdiff comment \u003cfile\u003e \u003cline\u003e --body ...   # add a new thread\ngitdiff reply \u003ctid\u003e --body ...             # reply to an existing thread\ngitdiff edit \u003ctid\u003e [--reply N] --body ...  # edit a thread body or its Nth reply\ngitdiff resolve \u003ctid\u003e | reopen \u003ctid\u003e       # toggle resolved\ngitdiff delete \u003ctid\u003e [--reply N]           # delete a thread or just one reply\n```\n\nBody input takes `--body \u003ctext\u003e`, `--body-file \u003cpath\u003e`, or `--body-stdin`\n(read from stdin). Thread ids accept any unique prefix (git SHA-style).\nAgents should pass `--author claude-code` (or their handle); the human\nreviewer then sees the thread highlighted as \"awaiting your reply\" in the\nTUI. Run `gitdiff --help` (or `gitdiff \u003csubcommand\u003e --help`) for the full\nclap-generated reference plus a live \"what diff would I auto-detect right\nnow\" trailer.\n\nExample agent loop:\n\n```sh\ngitdiff list --json                                          # see open threads\ngitdiff show t_a1b2c3 --json                                 # read one thread\n# ... agent makes the requested code change ...\ngitdiff reply t_a1b2c3 --author claude-code \\\n    --body 'addressed in commit c0ffee1'\ngitdiff resolve t_a1b2c3\n```\n\n## Keybindings\n\nPress `?` inside the app for the same list.\n\n```\nKeybindings\n\n  j / ↓        move down one line\n  k / ↑        move up one line\n  ctrl-d/u     half page down/up\n  g / G        top / bottom\n  ]   /   [    next / prev file\n  }   /   {    next / prev hunk\n\n  space        collapse / expand current hunk (on @@) or file (elsewhere)\n  z / Z        collapse all / expand all files\n  v            toggle viewed (auto-collapses)\n  y            yank current file path to clipboard\n  e            toggle file tree sidebar\n  R            toggle threads pane\n  t            fuzzy file picker\n\n  w            toggle ignore-whitespace\n  = / -        expand / shrink context lines\n  , / .        decrease / increase tab width\n\n  r            toggle resolved (on a commented line)\n  K / 0        add reaction / clear reactions (on a thread)\n  V            cycle review verdict (comment / approve / request changes)\n\n  c            add / edit comment on current line\n  x            delete comment on current line\n  S            submit threads → REVIEW.md at repo root\n\n  mouse        click to move cursor, click header to collapse, wheel to scroll\n\n  ?            toggle this help\n  q            quit (threads auto-persist to .gitdiff/threads.json)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzemse%2Fgitdiff-tui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzemse%2Fgitdiff-tui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzemse%2Fgitdiff-tui/lists"}