Skip to content

nkzw-tech/codiff

Repository files navigation

Codiff

Codiff is a beautiful, minimal, local diff viewer for reviewing staged and unstaged Git changes before committing.

Why Codiff

  • Fast Local Reviews: See changes in any Git repository to review code before committing.
  • LLM Walkthroughs: Run codiff -w to ask Codex to give you a review order and more context.
  • Inline Review Comments: Comment directly on changed lines and copy all review comments as Markdown for follow-ups.

Download

Install with Homebrew:

brew install --cask nkzw-tech/tap/codiff

Download the latest Codiff app from GitHub Releases.

After installing the app, run Codiff > Install Terminal Helper to make the codiff command available in your shell.

Command Line

codiff

Run it from any Git repository, or pass a path:

codiff /path/to/repository

Review a specific commit:

codiff a1b2c3d

Start with an LLM-generated walkthrough order:

codiff -w
codiff -w a1b2c3d

Show all available options:

codiff --help

Launching Codiff in multiple repositories opens a separate native window for each repository.

Command Bar

Open the command bar with Cmd+Shift+P on macOS, or Ctrl+Shift+P on other platforms. Type to filter commands, use Up/Down to move through results, press Enter to run the selected command, and press Esc to close it.

The command bar includes actions for common review workflows:

  • Focus File Filter
  • Find in Diffs
  • Show File Tree, Show History, and Show Walkthrough
  • Copy Review Comments
  • Copy Review Comments and Close
  • Toggle Viewed for the currently selected file
  • Open the currently selected file in your editor
  • Toggle Sidebar
  • Reload Window

Configuration

Codiff reads configuration from ~/.codiff/codiff.jsonc. Open Codiff > Open Config File... to create the file with defaults and open it in your editor. The file supports JSONC comments and trailing commas, includes a JSON schema reference for editor completion, and is watched while Codiff is running so changes apply to open windows.

{
  "$schema": "https://raw.githubusercontent.com/nkzw-tech/codiff/main/src/config/codiff-config.schema.json",
  "settings": {
    "copyCommentsOnClose": false,
    "lastRepositoryPath": "",
    "openAIModel": "gpt-5.3-codex-spark",
    "showWhitespace": false,
    "theme": "system",
  },
  "keymap": {
    "commandBar": "Mod+Shift+p",
    "diffSearch": "Mod+f",
    "fileFilter": "Mod+p",
    "nextSearchMatch": "Enter",
    "prevSearchMatch": "Shift+Enter",
    "closeSearch": "Escape",
    "submitComment": "Mod+Enter",
    "discardComment": "Escape",
    "toggleSidebar": "Mod+b",
  },
}

Use Mod for Cmd on macOS and Ctrl on other platforms. Shortcut strings can combine Mod, Ctrl, Alt, Shift, or Meta with a key, for example Mod+Shift+p or Alt+Enter.

Codex Walkthroughs

Codiff uses the local Codex CLI for walkthroughs and inline review assistance. Install Codex and verify it is available before using codiff -w:

codex --version

Codiff looks for Codex on PATH, /opt/homebrew/bin/codex, and /usr/local/bin/codex. It does not run your shell startup files to discover Codex. If Codex is installed somewhere else, launch Codiff with an explicit path:

CODIFF_CODEX_PATH=/absolute/path/to/codex codiff -w

Development

vp install
vp build
vpr codiff

For live development:

vpr dev
ELECTRON_RENDERER_URL=http://127.0.0.1:5173 vpr electron

Useful checks:

vp check
vp test
vp build

About

a fast local diff viewer

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors