Lumiere logo

Lumiere

Review diffs in the terminal and discuss them live with your coding agent.

Lumiere is a high-performance, side-by-side terminal diff viewer written in Rust. It is built for the modern code-review loop with coding agents: inspect uncommitted changes, feature branches, commit ranges, or GitHub pull requests, leave inline threaded comments directly on hunks or line selections, and converse with your agent inside the same thread without ever leaving the review.

Side-by-side diff view in full-file mode
Side-by-side diff with Tree-sitter syntax highlighting and word-level emphasis.
Hunks-only view folding unchanged code
Hunks-only view by default — press z to unfold or refold unchanged lines.
Inline review thread with agent reply
Threaded discussions anchored to lines, hunks, or files with live Markdown rendering.
Agent picker listing coding agents running in Rex
Press A to discover and attach to coding agents running in the repository.

What makes Lumiere different

  • Built around review threads, not one-way notes. Start a thread on a mouse selection, a focused hunk, or an entire file. Send comments immediately (Enter) or queue a batch (Alt+Enter / Ctrl+S) and dispatch them together (s). Your agent replies via lumiere thread reply, and its response appears live inside the open TUI.
  • Hunks-only by default, full file one key away. Just like GitHub PR reviews, Lumiere opens focused on changes with three context lines around every hunk. Lines anchored by review threads remain visible even when far from a diff hunk.
  • Multi-repository workspaces. Run lumiere diff in a folder containing several repositories (such as api/ and web/). Switch between them with R while preserving each repository's threads, viewed markers, and scroll position, and send queued feedback across all repositories in one message.
  • Git and Jujutsu native. Backed directly by libgit2 (vendored) and jj-lib — no shelling out to git diff on every keystroke.
  • Designed for speed and zero idle cost. Lazy per-language Tree-sitter grammar compilation, cached diff metrics, non-blocking background Rex discovery, and event-driven redraws keep startup fast and idle watch CPU at ~0%.

Where to go next

Origin & License

Lumiere started as a fork of Lumen v2.32.0 by Sahaj Jain and is now independently developed and architected around threaded agent reviews, workspace reviews, and high-performance TUI primitives. Licensed under the MIT License.

Installation

Lumiere targets Linux and macOS and requires Rust 1.89 or later when building from source.

Install with Cargo

Install the latest version directly from GitHub:

cargo install --git https://github.com/aduverger/lumiere --locked

Or from a local clone:

git clone https://github.com/aduverger/lumiere.git
cd lumiere
cargo install --path . --locked

Both commands place the lumiere binary in ~/.cargo/bin.

Building without Jujutsu (jj-lib)

Jujutsu support is enabled by default via the jj Cargo feature. If you only use Git and want a smaller binary and faster compile time, build with --no-default-features:

cargo install --path . --locked --no-default-features

Pre-built binaries

Tagged releases publish pre-built archives and SHA-256 checksums on the GitHub Releases page for:

  • x86_64-unknown-linux-gnu
  • aarch64-apple-darwin (Apple Silicon)
  • x86_64-apple-darwin (Intel macOS)

Nix Flake

If you use Nix with flakes enabled:

nix run github:aduverger/lumiere -- diff

Or install it into your profile:

nix profile install github:aduverger/lumiere

Optional integrations

ToolNeeded for
GitHub CLI (gh)Reviewing GitHub PRs via --pr / --detect-pr and syncing file viewed checkboxes
RexLive two-way review threads with coding agents running in sibling terminal panes
piThe /lumiere slash command inside pi (see below)

Installing the pi extension

If you use the pi coding agent, symlink pi-extension/ once from your checkout and run /reload inside pi:

ln -s "$(pwd)/pi-extension" ~/.pi/agent/extensions/lumiere

See Coding Agents & Rex Integration for how /lumiere behaves inside and outside Rex.

Quick Start

Run lumiere diff from any directory inside a Git or Jujutsu repository (or from a parent workspace folder containing several repositories).

Common starting commands

# Uncommitted working-tree changes
lumiere diff

# Everything added on your feature branch, including uncommitted edits
lumiere diff origin/main...-

# Reload automatically whenever you or your agent edit files
lumiere diff origin/main...- --watch

# Review a range of commits one commit at a time
lumiere diff main..feature --stacked

# Review a GitHub pull request (requires `gh`)
lumiere diff --pr 123
lumiere diff --detect-pr

A 60-second review workflow

  1. Move between files and hunks.

    • Press Alt+Down / Alt+Up (or Opt+k / Opt+j on macOS) to step between files, or Ctrl+P for the fuzzy file picker.
    • Press ] and [ to jump between hunks. Press m to dim a hunk as reviewed and advance to the next one.
    • Press z at any time to toggle between hunks-only view and the full file.
  2. Search across the diff.

    • Press / to search incrementally in the current file (n/N to step through matches).
    • Press Ctrl+F for Telescope-style fuzzy search across every file in the diff with a live syntax-highlighted preview pane.
  3. Start a review thread.

    • Focus a hunk with ] / [, or click-and-drag with the mouse to select specific lines or characters.
    • Press i to open the inline comment editor.
    • Press Enter to save and send immediately to your attached coding agent, or Alt+Enter (Ctrl+S) to queue the comment for later batch sending.
  4. Review responses live.

    • When an agent runs lumiere thread reply <id> --body '...', Lumiere detects the file update and renders the reply live in your diff view.
    • Press t on any thread (or click a ⋯ truncation row) to open the full scrollable thread modal with Markdown formatting and syntax-highlighted code snippets.
    • Press x to resolve a thread once satisfied.
  5. Mark files viewed and finish.

    • Press Space in the diff view to mark the current file as viewed and jump to the next unviewed file.
    • Press s to send all queued comments as a single message (or export them to stdout when no agent is attached).
    • Press q to quit, or ? at any time to inspect the full keybinding sheet.

Review Targets & References

lumiere diff accepts a wide set of Git, Jujutsu, and GitHub pull request targets. You can invoke it from any subdirectory of a repository.

Revision reference syntax

ReferenceMeaningTypical use
(none)Working tree vs parent (HEAD in Git, @- in Jujutsu)Review uncommitted changes
SHA / REFSingle commit vs its parentInspect one commit
A..BTree diff from A to BCompare two commits or branches directly
A...BTree diff from merge-base(A, B) to BCompare a branch tip against where it forked
A..-Tree diff from A to the current working treeCompare everything from A including uncommitted edits
A...-Tree diff from merge-base(A, HEAD) to the working treeBest for feature branches — ignores commits added to A after you branched

Why origin/main...-? When origin/main advances while you work on a feature branch, origin/main..- starts showing changes other teammates merged into main. Using three dots (origin/main...-) computes the merge base with your current commit and compares it to your live working tree, so you always review only your branch plus uncommitted changes.

Watch mode (--watch / -w)

Pass --watch (or toggle it interactively with w) to reload automatically when files change on disk or when Git writes refs/index updates during a commit or checkout:

lumiere diff origin/main...- --watch
  • Changes are gathered over a 500 ms debounce window so rapid saves or formatter passes collapse into a single reload.
  • Files that change on disk are automatically unmarked as viewed so you never miss new edits by an agent or formatter.
  • On Linux, the watcher walks the repository and skips directories ignored by Git (such as node_modules/, .venv/, and target/), avoiding inotify watch exhaustion and startup delays.
  • Watch mode is unavailable in GitHub PR mode (--pr / --detect-pr).

Stacked commit review (--stacked)

Review a multi-commit branch one commit at a time:

lumiere diff main..feature --stacked
lumiere diff main...feature --stacked
  • A compact header bar displays the VCS (git or jj), commit index (1/6), commit ID (plus short change_id in Jujutsu), and commit summary.
  • Press Ctrl+L / Ctrl+H (or click ‹ / › in the header) to step forward and backward through commits.
  • Empty commits are automatically filtered out.
  • Viewed-file checkboxes are remembered independently per commit SHA while switching back and forth.

GitHub pull requests (--pr / --detect-pr)

Review a GitHub PR without checking out its branch locally (requires an authenticated gh CLI):

# By PR number (uses origin remote, or override with --origin owner/repo)
lumiere diff --pr 123
lumiere diff 123

# By full URL
lumiere diff --pr https://github.com/owner/repo/pull/123
lumiere diff https://github.com/owner/repo/pull/123

# Auto-detect the PR for the current branch
lumiere diff --detect-pr
  • Base and head file contents are fetched in parallel (bounded to 8 concurrent gh api workers to stay comfortably below GitHub secondary rate limits).
  • Fork PRs (including PRs whose fork repository has since been deleted) are supported cleanly.
  • File viewed status (Space) syncs bidirectionally with GitHub's "Viewed" checkboxes via GraphQL mutations.
  • Press o to open the current file directly in your browser at its exact #diff-<sha256> anchor on GitHub.

Filtering and focusing files

# Limit the review to specific paths
lumiere diff -f src/lib.rs -f src/ui/mod.rs

# Open with a specific file selected first
lumiere diff --focus src/ui/mod.rs

Git and Jujutsu (--vcs)

Lumiere automatically detects whether the directory is a Jujutsu repository (.jj), a colocated Jujutsu+Git repository (prefers Jujutsu by default), or a Git repository (.git). Override auto-detection with the global --vcs flag before diff:

lumiere --vcs git diff
lumiere --vcs jj diff @---..@

In Jujutsu repositories, Lumiere also prints helpful translation hints if Git-style refs such as HEAD~2 are accidentally supplied (@---).

Navigating Diffs

Lumiere presents a collapsible file tree on the left ([1] Files) and a side-by-side diff canvas ([2] Old / New) on the right, backed by a status footer.

Hunks-only vs. full-file view

By default, Lumiere opens in hunks-only mode: each changed hunk is displayed with 3 lines of surrounding context, and untouched sections collapse into compact separator rows (⋯ 63 unchanged lines).

  • Press z to toggle between hunks-only and full-file mode at any time. Lumiere anchors the focused hunk (or top visible line) in place so your eye never loses its spot.
  • Lines anchored by a review thread are never folded away, even when far from any changed hunk.
  • Added files and deleted files automatically render in a clean single-panel layout ([2] New File / [2] Deleted File) in both modes.
  • Set "view": "full" in lumiere.config.json or pass --view full if you prefer whole files by default.

Panel layout and line wrapping

  • Tab toggles the file tree sidebar on and off.
  • 1 focuses the sidebar; 2 focuses the diff view.
  • 0 toggles fullscreen Old panel; - toggles fullscreen New panel; = returns to side-by-side.
  • Pass --wrap (or "wrap": true in config) to soft-wrap long lines with preserved leading indentation rather than scrolling horizontally (h / l).

Moving through files and hunks

  • Jump between files: Alt+Down / Alt+Up, Alt+K / Alt+J, or Ctrl+K / Ctrl+J.
  • Fuzzy file picker: Press Ctrl+P to filter changed files by path.
  • Step between hunks: Press ] (next hunk) and [ (previous hunk). A focused vertical bar (▎) highlights the active hunk.
  • Mark progress:
    • Press m in the diff view to mark the focused hunk as viewed (dimming its diff tint while keeping its gutter colored) and automatically advance to the next hunk.
    • Press Space in the diff view to mark the current file viewed (✓) and jump directly to the next unviewed file.
    • In the sidebar, Space toggles viewed status on a file or recursively on an entire directory; Enter opens a file or collapses/expands a directory.

Sticky scope context

When scrolling inside a function, class, impl block, or method in supported languages (Rust, Python, TypeScript, JavaScript, Go, C, C++, Java), Lumiere pins enclosing scope headers at the top of each panel (12 ~ fn render_diff(...)) using Tree-sitter AST queries.

Large files (> 1 MB): Files over 1 MB skip whole-file Tree-sitter parsing and sticky context headers to keep navigation instantaneous. Lines are still syntax-highlighted on demand line by line, and the footer displays large file: colours are approximate.

In-file search (/) and global fuzzy search (Ctrl+F)

ModeTriggerScopeNavigation
In-file search/Lines currently visible in the active fileEnter confirms, n/N or ↓/↑ step matches, Esc clears
Global fuzzy searchCtrl+FAll lines across every changed fileTelescope-style 50/50 split with fuzzy matching (nucleo-matcher) and syntax-highlighted unified preview

In Global fuzzy search:

  • Type to fuzzy-filter across filename:line content.
  • Move with ↓/↑, Ctrl+N/Ctrl+P, PageUp/PageDown, or mouse click/wheel. Hold Shift + scroll wheel to pan either pane horizontally.
  • Press Enter to jump straight to that file and line. If the target line was folded in hunks-only view, Lumiere automatically switches to full-file view so the match lands cleanly on screen.

Mouse selection, copying, and external editor

  • Character selection: Click and drag anywhere in the code area of either panel.
  • Line selection: Click and drag inside the line-number gutter.
  • Actions on selection: Release the mouse to see the inline action bar (i annotate y copy esc). Press y to copy the selected text (or the current filename when nothing is selected) to the system clipboard.
  • Open in $EDITOR: Press e to open the current file in $EDITOR (default vim), jumping to the focused hunk's line number (+<line>). $EDITOR supports shell-style arguments such as code --wait.

Review Threads

Review threads are the heart of Lumiere. Instead of copying line numbers into a chat window and losing context, you attach threaded discussions directly to the diff and let your coding agent reply right back inside Lumiere.

Anchoring targets

When you press i to comment, Lumiere picks the target automatically using a clear precedence order:

  1. Active mouse selection — attaches to the selected line range on the selected panel (Old or New).
  2. Focused hunk — if no lines are selected, attaches to the changed lines of the focused hunk (New side by default, Old side for pure deletions or when viewing only the Old panel via 0).
  3. Whole file — if neither lines nor a hunk are focused, attaches a file-level thread pinned at the top of the diff.

If an open thread already overlaps the target lines, pressing i continues that thread (editing your unsent draft if one exists, or starting a reply if everything was already sent). Clicking an inline thread box also opens the reply/draft editor directly.

Writing, sending, and queueing comments

Inside the inline comment editor:

KeyAction
EnterSave the comment and send it immediately to the attached agent
Alt+Enter or Ctrl+SSave the comment as queued (not sent yet)
Shift+Enter or Ctrl+JInsert a newline
Ctrl+U / Cmd+BackspaceDelete back to start of line
Esc or Ctrl+CCancel without saving
  • Clicking outside the inline editor saves a non-empty draft as queued (or deletes an emptied existing draft).
  • While a comment is queued, it is marked · queued in the thread box and counted in the footer (· 3 queued). Queued comments stay private from the agent until you send them with s.
  • If no agent is attached, Enter queues the comment instead, and pressing s prompts to exit Lumiere and write all queued comments to stdout in GitHub-style Markdown (for piping or the non-Rex pi integration).
  • Pressing q with queued comments still unsent prompts you to send/export them, exit keeping them queued for later, or cancel.

Reading long threads and Markdown formatting

Inline thread boxes stay compact so they never overwhelm the diff:

  • Older comments fold into ⋯ N earlier comments (t to view).
  • Very long single comments fold trailing lines into ⋯ N more lines (t to view).
  • Press t on a thread (or click any ⋯ indicator row) to open the focused Thread View modal:
    • Displays up to 8 lines of syntax-highlighted anchored code at the top.
    • Renders full CommonMark comments including headings, bold, italic, strikethrough, bullet/numbered/task lists, blockquotes, links, inline code, and fenced code blocks highlighted with Tree-sitter (falling back to the reviewed file's language when a fence is untagged).
    • Opens pinned to the latest reply; scroll with j/k, arrows, PageUp/PageDown, Home/End/G, or the mouse wheel.
    • Press i inside the modal to dock the reply editor at the bottom while keeping the conversation readable above.

Resolving and browsing threads

  • Press x on a thread (in the diff view, the thread modal, or the threads list) to resolve or reopen it. Resolved threads collapse to a single muted line (✓ resolved · author: ...). Replying to a resolved thread automatically reopens it.
  • Press I to open the Threads list across the current repository:
    • By default, resolved threads are hidden (Threads (2) · 3 resolved hidden). Press r to toggle showing resolved threads.
    • Press Enter to open the focused Thread View (dismissing returns to the list), g to jump straight to the thread's lines in the diff, e to jump and open the inline editor, x to resolve/reopen, or d to delete.

Persistence and outdated tracking

Threads are persisted outside your Git working tree in ~/.local/state/lumiere/<repo-hash>/threads.json (respecting XDG_STATE_HOME on Linux and ~/Library/Application Support/lumiere/ on macOS):

  • Threads are shared across all diff ranges reviewed in the same repository and survive restarts.
  • External replies written by lumiere thread reply are picked up automatically by the running TUI without manual refresh.
  • Whenever the diff reloads, Lumiere re-anchors every line-range thread:
    • If the exact anchored snippet still matches the same line range, nothing changes.
    • If lines shifted up or down, Lumiere relocates the thread if the snippet matches at exactly one location on the same panel side.
    • If the snippet was edited, deleted, or matches ambiguously, the thread is marked outdated while preserving its conversation history.

Coding Agents & Rex Integration

Lumiere turns code review into a live back-and-forth loop with coding agents running alongside it in Rex terminal panes — and still works seamlessly without Rex via stdout export or the pi extension.

How live agent discovery works

When you open lumiere diff, Lumiere spawns a background worker that queries Rex (never blocking your first keystrokes):

  1. It enumerates Rex sessions and terminal panes.
  2. It looks for panes whose foreground process matches a known coding agent reporting Rex OSC 7501 program status and whose working directory is at or inside the reviewed repository (or workspace root).
  3. It attaches to the most recently active matching agent pane and shows its name and state in the footer (for example, · pi idle or · codex working).
  4. Every 3 seconds, the background worker refreshes the attached pane's status without stalling the UI.

Recognized agents

An agent is discovered automatically when it reports Rex program status with a matching foreground PID:

  • Tested: pi, claude-code, codex (0.163+), antigravity
  • Recognized by name: opencode, hermes, grok, grok-build

Press A at any time to open the Agents picker, switch to another running agent pane, or choose none to detach. You can also target an explicit pane or terminal ID at startup with --agent-target <TARGET> (or the --agent-block alias for Rex).

Safety guards before sending

Lumiere enforces strict safety checks right before pasting comments into a terminal pane:

  • Foreground PID verification: A pane only counts as an active agent if the status record's owner_pid equals the pane's current foreground_pid. If the agent exited back to your shell, Lumiere drops the attachment and refuses to paste into your shell.
  • Blocked-state check: If the agent's Rex status is blocked (e.g., waiting for tool permission or confirmation), Lumiere leaves your comments queued and notifies <agent> is waiting for you, preventing accidental submission of a permission prompt.
  • Bracketed paste & control-character sanitization: Comments are wrapped in ANSI bracketed paste (\x1b[200~...\x1b[201~) and stripped of all control characters other than \n, so multi-line messages never trigger premature submission or escape the paste boundary.

What the agent receives and how it replies

When you send one or more comments, Lumiere delivers a structured prompt containing:

  • Each thread's ID, file path, line range, side (LEFT / RIGHT), and (for the first comment on a thread) the anchored code snippet.
  • Instructions asking the agent to reply inside the thread first (and wait for your approval before editing code).
  • The exact lumiere thread reply command to run (using the full executable path if lumiere is not shadowed on PATH, and including lumiere thread show when continuing a thread with earlier comments).

Agents interact with review threads using three CLI subcommands:

# List threads that have been sent to the agent (--awaiting filters to ones waiting for a reply)
lumiere thread list [--awaiting] [--json] [--repo PATH]

# Inspect full history and anchored code for one thread
lumiere thread show <thread-id> [--json] [--repo PATH]

# Post a reply into the thread (immediately reflected in the open Lumiere UI)
lumiere thread reply <thread-id> --body "Agreed — I can extract that helper." [--repo PATH] [--author NAME]
echo "Multiline reply" | lumiere thread reply <thread-id> --stdin [--repo PATH]

Privacy of drafts: Queued comments that you have not sent yet are invisible to lumiere thread list, show, and reply. Resolved threads reject new agent replies until you reopen them.

Using /lumiere inside pi

After symlinking pi-extension/ into ~/.pi/agent/extensions/lumiere and running /reload:

/lumiere                    # runs: lumiere diff origin/main...- --watch
/lumiere diff HEAD~3..-     # passes any custom lumiere arguments
  • Inside Rex: /lumiere opens Lumiere in a zoomed split pane beside pi, passing --agent-block automatically so comments flow straight to that pi session while pi stays active behind the zoom. Unzoom the pane to view both side by side.
  • Outside Rex: /lumiere temporarily suspends pi's TUI while you review. Leave comments, then press s and Enter to exit and hand the formatted review directly to pi as a user message. Pressing q discards sending.

Set LUMIERE_BIN=/path/to/lumiere if your lumiere binary is not on PATH.

Multi-Repository Workspaces

When a feature spans multiple repositories — such as an api/ backend and a web/ frontend checked out under a shared folder — you can review them all in one Lumiere session.

Starting a workspace review

Run lumiere diff from a parent folder that is not itself a Git or Jujutsu repository, but contains repositories as immediate subdirectories:

cd ~/code/my-project     # contains api/, web/, shared/
lumiere diff origin/main...- --watch

Discovery rules

  • Only immediate child directories containing .git or .jj are discovered, sorted alphabetically by directory name.
  • Plain folders without a VCS marker and symlinked directories are ignored.
  • Lumiere opens the first repository (by name) that has changes for the requested reference, or the first reviewable repository if all are clean.
  • If a repository lacks the requested revision (for example, origin/main does not exist in one repo), it remains visible in the repository picker and displays the error if selected.

Switching repositories and managing state

  • Press R to open the Repositories picker. It marks the current repository, shows thread counts for every opened repository, and flags unavailable repositories.
  • The footer prefixes the current branch or reference with the repository name (api · origin/main...-).
  • Switching repositories parks the previous repository's full AppState in memory — preserving its open threads, viewed files, viewed hunks, collapsed directories, and scroll position.
  • Watch mode (w) follows the repository currently on screen; returning to a parked repository while watch mode is enabled triggers a fresh reload so edits made while off-screen are picked up.

Threads and agents across a workspace

  • Per-repository storage: Each repository keeps its own threads.json under Lumiere's state directory.
  • Combined sending: Pressing s sends (or exports) queued comments across every repository opened in the session, grouped under # Repository: <name> (<absolute-path>) headings.
  • Agent discovery: Lumiere searches Rex for agents working in the workspace folder or any discovered repository root (or subdirectories thereof).
  • Agent CLI: lumiere thread list, show, and reply work seamlessly from the workspace folder (--repo ~/code/my-project) — locating threads by ID across all child repositories and showing each repository's name in listings.

Workspace limitations

  • --pr, --detect-pr, and --stacked require a single repository and report an error if run from a multi-repository workspace folder.
  • The threads list (I) shows threads for the repository currently on screen.

CLI Reference

lumiere [GLOBAL OPTIONS] <COMMAND>

Global options

Place global options before the subcommand (diff or thread):

FlagDescription
--config <PATH>Path to a JSON config file (overrides ~/.config/lumiere/lumiere.config.json)
--vcs <git|jj>Force the version control backend instead of auto-detecting
-h, --helpPrint help
-V, --versionPrint version

lumiere diff

Launch the interactive side-by-side diff viewer.

lumiere diff [OPTIONS] [REFERENCE]

Positional argument

ArgumentDescription
[REFERENCE]Revision target (SHA, A..B, A...B, A..-, A...-), or a GitHub PR number/URL. Omit for uncommitted working-tree changes.

Options

OptionDescription
--pr <PR>View a GitHub pull request by number or URL (conflicts with --detect-pr)
--detect-prAuto-detect the GitHub PR associated with the current branch
-f, --file <PATH>Filter the diff to specific file paths (repeatable)
-w, --watchWatch the repository and auto-reload on file or VCS changes
-t, --theme <NAME>Override color theme (see Configuration & Themes)
--stackedReview a commit range (A..B or A...B) commit by commit
--focus <PATH>Start with the specified file selected
--origin <OWNER/REPO>GitHub owner/repo override when --pr is given as a number
--wrapSoft-wrap long diff lines instead of horizontal scrolling
--view <hunks|full>Initial view mode (hunks default, full for whole files)
--agent-target <TARGET>Explicit target pane or terminal ID of the coding agent to attach to (alias: --agent-block)

lumiere thread

Read and answer review threads stored by lumiere diff. Works from a single repository or a multi-repository workspace folder.

lumiere thread list

lumiere thread list [--awaiting] [--json] [--repo <PATH>]
OptionDescription
--awaitingShow only open threads whose last sent comment is the reviewer's
--jsonEmit structured JSON instead of plain text
--repo <PATH>Repository or workspace folder path (default: current directory)

lumiere thread show

lumiere thread show <THREAD_ID> [--json] [--repo <PATH>]

Displays the thread metadata, anchored code snippet, and all non-queued comments.

lumiere thread reply

lumiere thread reply <THREAD_ID> (--body <TEXT> | --stdin) [--repo <PATH>] [--author <NAME>]
OptionDescription
--body <TEXT>Reply body text (mutually exclusive with --stdin)
--stdinRead reply body from standard input
--repo <PATH>Repository or workspace folder path (default: current directory)
--author <NAME>Author label recorded on the reply (default: agent)

Refuses to reply to unknown IDs, resolved threads, empty bodies, or threads that only contain unsent queued drafts.

Configuration & Themes

Configuration file

Lumiere reads ~/.config/lumiere/lumiere.config.json by default, or the path supplied with --config <PATH> before diff.

{
  "theme": "catppuccin-mocha",
  "wrap": false,
  "view": "hunks"
}

Supported keys

KeyTypeDefaultDescription
themestringauto-detectedColor theme name (see table below)
wrapbooleanfalseSoft-wrap long diff lines instead of horizontal scrolling
view"hunks" | "full""hunks"Default diff view mode (z toggles interactively)

A missing default config file is silently ignored. A malformed JSON file or a missing explicit --config path is reported as a clear error on startup.

Precedence rules

  • Theme: --theme CLI flag → theme in config file → LUMIERE_THEME environment variable → terminal light/dark background auto-detection (terminal-light).
  • Wrap: --wrap CLI flag OR wrap: true in config file.
  • View mode: --view CLI flag → view in config file → "hunks".

Built-in themes

Theme names are matched case-insensitively (hyphens and underscores are interchangeable for most variants):

FamilyTheme name(s)Mode
Defaultdark, lightDark / Light
Catppuccincatppuccin-mocha (alias catppuccin), catppuccin-latteDark / Light
DraculadraculaDark
NordnordDark
One Darkone-dark (alias onedark)Dark
Gruvboxgruvbox-dark (alias gruvbox), gruvbox-lightDark / Light
Solarizedsolarized-dark (alias solarized), solarized-lightDark / Light
Flexokiflexoki-dark (alias flexoki), flexoki-lightDark / Light

Environment variables

VariableEffect
LUMIERE_THEMEDefault theme when neither --theme nor config.theme is set
EDITORExternal editor launched by e (supports arguments, e.g. code --wait; defaults to vim)
XDG_STATE_HOMEBase directory for persisted threads.json files on Linux (defaults to ~/.local/state)
REX_SESSIONCurrent Rex session ID used with --agent-block
LUMIERE_BINOverride binary path used by the pi-extension/ /lumiere command

Keybindings

Press ? anywhere in Lumiere to open the interactive, scrollable keybinding sheet. On Linux and Windows, Opt corresponds to Alt.

Global

KeyAction
q / Ctrl+CQuit (prompts if queued comments remain)
TabToggle sidebar visibility
1 / 2Focus sidebar / diff view
Opt+↓ / Opt+K / Ctrl+KNext file
Opt+↑ / Opt+J / Ctrl+JPrevious file
Ctrl+D / Ctrl+UScroll half page down / up
Ctrl+POpen fuzzy file picker
rRefresh diff / reload PR
RSwitch repository (in a workspace folder)
AChoose coding agent pane (or detach)
yCopy active text selection, or current filename
eOpen current file in $EDITOR (at focused hunk line)
oOpen current file on GitHub (PR mode)
Ctrl+L / Ctrl+HNext / previous commit (--stacked mode)
?Show keybindings modal
KeyAction
j / ↑Move up
k / ↓Move down
h / l or ← / →Scroll horizontally
EnterOpen file in diff view, or collapse/expand directory
SpaceToggle viewed status for file or entire directory

Diff view

KeyAction
j / ↑Scroll up (or previous search match with arrows when search is active)
k / ↓Scroll down (or next search match with arrows when search is active)
h / l or ← / →Scroll horizontally (when --wrap is off)
PageUp / PageDownScroll 20 lines up / down
gg / GJump to top / bottom of file
[ / ]Focus previous / next hunk
mToggle focused hunk viewed and advance to next hunk
SpaceToggle current file viewed and jump to next unviewed file
zToggle hunks-only / full-file view
wToggle file watch mode
0Toggle fullscreen Old panel
-Toggle fullscreen New panel
=Reset to side-by-side panels
EscClear active selection, or clear active search highlight
KeyAction
/Start in-file incremental search (Opt+Backspace / Ctrl+W erases word)
Ctrl+FOpen global fuzzy search across all files with live preview
n / NJump to next / previous in-file match
Esc / Ctrl+CCancel search

Review threads

KeyAction
iComment on selection / hunk / file, or reply / edit unsent draft
Enter (in editor)Save comment and send immediately to the attached agent
Alt+Enter / Ctrl+S (in editor)Save comment as queued
Shift+Enter / Ctrl+J (in editor)Insert newline
tOpen thread at cursor in focused scrollable Thread View modal
xResolve or reopen thread at cursor
IOpen Threads list (Enter open, g jump, e edit/reply, x resolve, r show/hide resolved, d delete)
sSend all queued comments (or export to stdout when no agent is attached)

Architecture & Core Primitives

Lumiere is organized as a library crate (src/lib.rs) paired with a minimal CLI entrypoint (src/main.rs). Rather than sprawling feature folders with circular dependencies, the codebase is structured around five orthogonal primitives with strict one-way dependencies.

The five primitives

                       ┌─────────────────────┐
                       │   main.rs / lib.rs  │   CLI dispatch & error boundary
                       │  cli.rs · config.rs │
                       └──────────┬──────────┘
                                  │
                                  ▼
                       ┌─────────────────────┐
                       │         ui/         │   Model-Update-View Ratatui TUI
                       │  App · State · View │   TerminalGuard · Event Loop
                       └──┬───────┬───────┬──┘
                          │       │       │
            ┌─────────────┘       │       └─────────────┐
            ▼                     ▼                     ▼
  ┌──────────────────┐  ┌──────────────────┐  ┌──────────────────┐
  │     search/      │  │     review/      │  │      diff/       │
  │ SearchState      │  │ Thread · Store   │  │ FileDiff         │
  │ GlobalSearch     │  │ AgentLink/Worker │  │ ComputedDiff     │
  └────────┬─────────┘  │ Workspace · CLI  │  │ Highlight · PR   │
           │            └────────┬─────────┘  │ Context · Watch  │
           └──────────────┐      │            └────────┬─────────┘
                          ▼      ▼                     │
                       ┌─────────────────────┐         │
                       │        diff/        │◄────────┘
                       └──────────┬──────────┘
                                  │
                                  ▼
                       ┌─────────────────────┐
                       │        vcs/         │   GitBackend (libgit2)
                       │  VcsBackend trait   │   JjBackend (jj-lib)
                       │  CommitReference    │   Repository detection
                       └─────────────────────┘

1. vcs — Version control source of truth (src/vcs/)

Defines the VcsBackend trait and CommitReference parser, abstracting Git (libgit2) and Jujutsu (jj-lib, feature-gated behind jj). All repository queries — changed file lists, file contents at any revision, merge bases, parent resolution, and commit ranges for --stacked — flow through this boundary. No module above vcs touches git2 or jj-lib directly.

2. diff — Pure diff computation & enrichment (src/diff/)

Turns VCS revisions (or GitHub PRs via diff::github) into FileDiff values and ComputedDiff views:

  • FileDiff holds raw old/new text, FileStatus, and binary detection.
  • ComputedDiff caches side-by-side paired DiffLine rows, hunk start offsets, LineStats (+added/-removed), maximum line widths, and thread-pinned ranges so rendering and scrolling stay O(1) even on 360k-line files.
  • diff::algo implements side-by-side pairing, word-level emphasis via similar, hunk boundary detection, and hunks-only folding.
  • diff::highlight and diff::context provide lazy per-language Tree-sitter syntax highlighting (mapping capture indices directly against the active ui::theme palette) and enclosing scope headers.
  • diff::watcher debounces filesystem and VCS events (skipping gitignored directories on Linux).

3. review — Threaded conversations, persistence & agent bridge (src/review/)

Owns all review-workflow state independent of any terminal UI:

  • Thread, Comment, Author, and AnnotationTarget model line-range and file-level conversations plus anchor-text re-matching.
  • ThreadStore reads and writes versioned threads.json files safely across concurrent processes (lumiere diff and lumiere thread reply) using advisory file locks and atomic temp-file rename.
  • review::cli implements lumiere thread {list, show, reply} directly on top of ThreadStore and Workspace.
  • review::agent defines the host-agnostic AgentHost trait (AgentTarget, AgentStatus, AgentState), AgentLink, and non-blocking AgentWorker, with review::agent::rex::RexHost providing the Rex implementation.
  • review::workspace discovers sibling repositories under a workspace directory without importing any UI types.

4. search — In-file & global fuzzy search (src/search/)

  • SearchState performs case-insensitive UTF-8-safe match scanning over visible diff rows (with an ASCII fast path and full Unicode char-boundary mapping for expanding case folds).
  • GlobalSearchState indexes every non-blank line across all diff files into nucleo-matcher and caches syntax highlighters lazily for the Telescope-style preview pane.

5. ui — Model-Update-View Ratatui frontend (src/ui/)

Clean separation of lifecycle, state, input transitions, and pure rendering:

  • ui/mod.rs: TerminalGuard (RAII Drop + panic hook that restores raw mode, alternate screen, mouse capture, and kitty keyboard enhancement flags on error or unwind), App runtime container, non-blocking AgentWorker polling, and event-driven dirty redraw loop.
  • ui/state.rs & ui/workspace.rs: AppState (owns ComputedDiff, cached branch name, sidebar tree, selection, and thread store connection) and WorkspaceSession (parks/swaps AppState per repository).
  • ui/input.rs: Pure keyboard and mouse handlers returning LoopAction (Continue, Quit, OpenExternalEditor), decoupled from terminal I/O so entire user flows can be tested headlessly.
  • ui/views/: Stateless Ratatui rendering modules (diff, diff_lines, overlays, sidebar, footer, header, modal/{mod, thread, global_search}) driven by explicit input structs (DiffRenderInput -> DiffRenderOutput).

Key design invariants

  • Zero unsafe code: Enforced crate-wide via [lints.rust] unsafe_code = "deny".
  • Zero process::exit in library code: All failure modes bubble up as LumiereError to src/main.rs.
  • UTF-8 safety everywhere: Every text truncation, path abbreviation, search scan, selection extraction, and span split operates on char/grapheme boundaries — never raw byte slicing.
  • No external I/O on the render thread: Rex discovery, 3-second agent status refreshes, and A picker scans execute on the background AgentWorker thread over mpsc channels.

Diff Engine, Syntax & Rendering

This page explains how Lumiere transforms raw file versions into a syntax-highlighted, word-emphasized, thread-annotated side-by-side frame in milliseconds.

1. Loading diffs (src/diff/mod.rs & src/diff/github.rs)

DiffRefs::from_options resolves any CommitReference variant into one of four canonical strategies:

  • WorkingTree (parent -> disk)
  • Single(sha) (sha^ -> sha)
  • Range { from, to } (from -> to, with A...B resolved to merge-base(A, B) -> B)
  • RangeToWorkingTree { from } (from -> disk, with A...- resolved to merge-base(A, parent) -> disk)

For GitHub PRs (diff::github), Lumiere fetches metadata via parameterized GraphQL queries (gh api graphql -f ... -F ...) deserialized into typed serde structs — avoiding string interpolation and fragile manual JSON slicing. File contents for base and head revisions are pulled by a bounded pool of 8 worker threads (PR_FETCH_CONCURRENCY = 8).

2. Side-by-side pairing and word diff (src/diff/algo.rs)

compute_side_by_side diffs old_content against new_content using similar::TextDiff::from_lines:

  1. Consecutive Delete and Insert runs within a change group are paired into ChangeType::Modified rows up to min(deletes, inserts); leftover lines become standalone Delete or Insert rows with diagonal stripe placeholders on the opposite side.
  2. Each Modified pair runs similar::TextDiff::from_words to emit InlineSegment { text, emphasized } slices for intra-line word highlighting.
  3. Tabs are expanded consistently according to settings.tab_width (default 4).

Hunks-only folding

When settings.hunks_only is enabled, hide_unchanged_rows scans the paired rows and keeps:

  • Every non-Equal row plus HUNK_CONTEXT_ROWS (3) lines above and below each change.
  • Any row pinned by a review thread (thread.target covers that row's line number on the thread's panel).

Contiguous hidden runs collapse into a single DiffLine::separator(hidden_lines) row (⋯ N unchanged lines).

3. Caching in ComputedDiff

AppState wraps the active file's computed artifacts in a single ComputedDiff struct:

#![allow(unused)]
fn main() {
pub struct ComputedDiff {
    pub file_index: usize,
    pub rows: Vec<DiffLine>,
    pub hunks: Vec<usize>,
    pub stats: LineStats,
    pub max_old_width: usize,
    pub max_new_width: usize,
    pub pinned_ranges: Vec<(DiffPanelFocus, RangeInclusive<usize>)>,
}
}
  • Recomputing occurs only when switching files, reloading, toggling hunks-only/full-file view, or when a thread is added/removed on the active file.
  • Per-frame footer stats (+added -removed) and horizontal scroll bounds (max_h_scroll) are O(1) field reads instead of O(N) full-file scans.
  • Switching between hunks_only and full anchors either the focused hunk (when visible) or the top visible line number so the viewport stays rock-steady.

4. Lazy Tree-sitter highlighting & sticky scope context

Syntax highlighting (src/diff/highlight/)

Lumiere bundles 18 Tree-sitter grammars (Rust, TypeScript/TSX, JavaScript/JSX, Python, Go, C, C++, C#, Java, Zig, Ruby, Elixir, Bash, JSON, TOML, HTML, CSS, Markdown):

  • Lazy per-language initialization: Each language's HighlightConfiguration is compiled once on first use via std::sync::OnceLock, instead of compiling all 18 grammars at startup.
  • Whole-file FileHighlighter: Files up to 1 MB (MAX_WHOLE_FILE_BYTES = 1_048_576) are highlighted once into per-line byte-range token spans using a scope stack (so nested captures like string interpolations restore the enclosing color on HighlightEvent::HighlightEnd).
  • Large-file fallback: Files exceeding 1 MB skip whole-file parsing and highlight only the ~40 visible rows on demand using a thread-local tree_sitter_highlight::Highlighter (SNIPPET_HIGHLIGHTER), avoiding per-line parser allocations.

Sticky scope headers (src/diff/context.rs)

  • Scope queries for the 8 context-enabled languages are lazily compiled per language via OnceLock.
  • Given the top visible line number of each panel, compute_context_lines walks the cached Tree-sitter AST to find enclosing scopes (fn, impl, class, method, etc.) and slices each header line directly via O(line_len) byte scanning (line_at_byte) without collecting all file lines into a Vec.

5. Rendering pipeline (src/ui/views/)

render_diff(frame, &DiffRenderInput) produces a DiffRenderOutput containing layout feedback for mouse hit-testing (content_row_offset, overlay_gaps, annotation_rects, editor_rect):

  1. Unified panel paths: Added and deleted files share one render_single_panel implementation; side-by-side Old and New panels share one render_panel_row builder.
  2. Single-pass line styling (highlight_diff_line): Combines base syntax tokens, word-level diff emphasis (with automatic luminance/saturation boosting for low-contrast tokens), search match highlights, and blended mouse-selection tint in one UTF-8-safe pass.
  3. Inline overlays (overlays.rs): File-level threads reserve placeholder rows at the top; line-range threads inject synchronized placeholder gaps into both panels after end_line, then draw bordered Markdown thread boxes (or the inline AnnotationEditor) over those slots and extend the shared center-border marker (▎) for New-panel threads.
  4. Event-driven redraws: The event loop tracks app.dirty: bool and only invokes terminal.draw when user input, a resize, a file-watcher reload, a thread file change, an agent status transition, or notice expiration occurred.

Threads, Storage & Agent Protocol

Lumiere's review loop is designed so the interactive TUI (lumiere diff) and external agent commands (lumiere thread ...) can safely read and mutate the same conversation concurrently.

Data model (src/review/thread.rs)

A repository's review state is a list of Thread records:

  • id: 8-hex-character random identifier (e.g. 1a2b3c4d).
  • filename: Repository-relative path.
  • target: Either AnnotationTarget::File or AnnotationTarget::LineRange { panel: Old | New, start_line, end_line } (1-indexed inclusive).
  • anchor_text: Exact text of the anchored lines captured when the thread was created, used for relocating the thread across edits and showing context to agents.
  • outdated / resolved: Lifecycle flags.
  • comments: Ordered list of Comment { id, author: Human | Agent, author_name, body, created_at, queued }.

Visibility and turn-taking semantics

  • Queued drafts (queued: true): Newly created reviewer comments start queued until sent via Enter or s. All lumiere thread subcommands ignore queued comments, and a thread containing only queued comments is invisible to agents.
  • Awaiting agent (thread.awaiting_agent()): True when a thread is open (!resolved) and its most recent non-queued comment was written by Author::Human.
  • Outdated anchor refresh (refresh_anchors): On every diff reload:
    • File-level threads are outdated only if the file left the diff.
    • Line-range threads check if the lines at start_line..=end_line still match anchor_text. If not, Lumiere searches the file on the same panel side for anchor_text: a unique match updates start_line..=end_line seamlessly; zero or multiple matches flag outdated = true.

Concurrent persistence (src/review/store.rs)

Threads are stored outside the repository working tree so Git status stays completely clean:

<state_dir>/lumiere/<sha256(canonical_repo_root)[..16]>/threads.json

Where <state_dir> is $XDG_STATE_HOME (default ~/.local/state) on Linux and ~/Library/Application Support on macOS.

Schema (v1)

{
  "version": 1,
  "threads": [
    {
      "id": "1a2b3c4d",
      "filename": "src/ui/mod.rs",
      "target": {
        "kind": "line_range",
        "panel": "new",
        "start_line": 42,
        "end_line": 48
      },
      "anchor_text": "...",
      "created_at": 1764000000,
      "resolved": false,
      "outdated": false,
      "comments": [
        {
          "id": "9f8e7d6c",
          "author": "human",
          "author_name": "you",
          "body": "Should this restore flags on panic?",
          "created_at": 1764000000,
          "queued": false
        }
      ]
    }
  ]
}

Lock-and-rename concurrency protocol

Every write goes through ThreadStore::update:

  1. Acquire an exclusive OS advisory lock (File::lock, Rust 1.89+) on a sibling threads.lock file.
  2. Re-read the latest threads.json from disk inside the lock (so concurrent replies written by an agent seconds earlier are never clobbered).
  3. Reject files whose version != 1 without overwriting them (forward-compatibility safety).
  4. Apply the mutation closure.
  5. Write serialized JSON to a unique sibling temp file (threads.<pid>.<rand>.tmp) and atomically fs::rename it over threads.json.

Live TUI pickup without filesystem watches

On every loop tick, AppState::reload_threads_if_changed() compares StoreStamp ((len, modified_time) from a single stat() call) against the last loaded stamp. Whenever an agent runs lumiere thread reply, the stamp changes, Lumiere reloads threads.json, marks the frame dirty, and renders the reply live — even when --watch is off.

Agent host architecture (src/review/agent/)

Live coding-agent integration is decoupled from any single terminal or multiplexer via the AgentHost trait in src/review/agent/mod.rs (mirroring how vcs::VcsBackend abstracts Git and Jujutsu):

  • AgentHost exposes four host operations: list_agents(review_roots), find_agent(target_hint), inspect_agent(id), and send_message(id, message).
  • AgentTarget / AgentStatus / AgentState represent an opaque host-owned target ID, human-readable location label, working directory, app name, and semantic state (Idle, Working, Blocked, Done, Error, Other, Unknown).
  • AgentLink owns attachment state, Blocked send refusal, prompt formatting, and control-character stripping without importing any host-specific types.
  • RexHost (src/review/agent/rex.rs) is the current AgentHost implementation; future hosts (such as Herdr or tmux) plug in by implementing AgentHost and selecting the active host in default_host().

Non-blocking AgentWorker

Shelling out to a multiplexer CLI takes tens to hundreds of milliseconds. To keep startup and typing completely stall-free, AgentWorker::spawn runs a dedicated background thread sharing an Arc<dyn AgentHost> over std::sync::mpsc channels:

  • AgentRequest::Attach — dispatched immediately on startup before the first frame; updates the footer as soon as the host responds.
  • AgentRequest::Refresh — dispatched every 3 seconds while an agent target is attached (never overlapping an in-flight refresh; stale responses for a previously attached target are ignored by opaque id comparison).
  • AgentRequest::FindCandidates — dispatched when the user presses A, opening the picker immediately with cached candidates and refreshing it live when discovery finishes.

Rex host discovery & delivery (src/review/agent/rex.rs)

  • Discovery executes a single Lua script via rex do -s <session> --json to read each terminal block's process (foreground PID and CWD) and program_status (OSC 7501 records).
  • Only panes where a recognized coding agent's status owner.pid == foreground.pid and whose CWD is inside one of the review_roots qualify.
  • Delivery (AgentLink::send_comments) performs a live inspect_agent refresh first, aborts if the agent exited or its state is AgentState::Blocked, strips non-newline control characters, and delegates to RexHost::send_message, which wraps the prompt in bracketed paste (\x1b[200~...\x1b[201~) and submits with rex send-key ... enter.

Performance & Benchmarks

Lumiere is engineered to feel instantaneous on everyday commits while staying responsive on 300-file branches, 360,000-line generated files, and repositories with thousands of gitignored directories (such as .venv/ or node_modules/).

Benchmark suite

The repository includes an end-to-end PTY benchmark harness in bench/bench.py. Rather than benchmarking isolated functions, it launches the compiled release binary inside a 140×40 pseudo-terminal, feeds real terminal escape replies and keystrokes (Alt+k, z, q), and measures wall-clock latency, peak RSS memory, and idle CPU usage across four synthetic Git repositories:

Repository fixtureContents
small3 modified Python files (120 lines each)
many300 modified Python files across 15 directories (240 lines each)
large1 small Python file + 1 modified 360,000-line Python file
ignoredsmall plus 8,000 gitignored .venv/ subdirectories (48,000 files)

Running benchmarks locally

cargo build --release
python3 bench/bench.py run baseline --bin target/release/lumiere --runs 5
# ... make changes and rebuild ...
python3 bench/bench.py run candidate --bin target/release/lumiere --runs 5
python3 bench/bench.py compare baseline candidate

Measured results

Median of 5 runs on a 2-vCPU Linux host comparing the pre-refactor release binary (after) against the refactored release binary (refactored-final):

MetricBeforeAfterChange
Start (small repo)45.6 ms21.7 ms-52%
Start (small repo, --watch)50.8 ms22.4 ms-56%
File change to screen (--watch)522.3 ms504.0 ms-3%
Idle CPU (--watch)0.5%0.0%-100%
Peak memory (small repo)26.4 MB10.2 MB-61%
Start (many repo, 300 files)79.5 ms65.7 ms-17%
First key answered199.8 ms6.1 ms-97%
Next file (Alt+k)4.7 ms4.4 ms-6%
Start (many repo, --watch)74.1 ms68.6 ms-7%
Start (large repo, 360k lines)231.4 ms195.9 ms-15%
Open the 360k-line file250.4 ms206.8 ms-17%
360k-line file, toggle full-file view (z)237.5 ms184.2 ms-22%
Peak memory (large file)142.8 MB130.1 MB-9%
Start (large repo, --watch)242.5 ms194.7 ms-20%
Start (ignored repo, 8k .venv dirs)46.5 ms21.7 ms-53%
Start (ignored repo, --watch)44.5 ms26.0 ms-42%

[!NOTE] file change to screen, watch is intentionally bounded below by the 500 ms GATHERING_TIME debounce window in diff::watcher so editors that write temp files and rename them settle into a single reload.

Key architectural optimizations

1. Non-blocking background AgentWorker (-97% first-key latency)

Previously, Rex pane discovery ran synchronously on the UI thread immediately after the first frame (and again every 3 seconds for status refreshes and whenever opening the A picker). Any rex CLI invocation stalled the event loop for ~200 ms.

Now review::agent::AgentWorker runs all Rex queries on a dedicated background thread over std::sync::mpsc channels (Attach, Refresh, FindCandidates). The UI thread remains immediately responsive (6.1 ms first-key latency) and reconciles responses atomically on wakeup.

2. Event-driven dirty redraws (0.0% idle CPU)

Rather than redrawing the entire terminal unconditionally every poll interval, App tracks a dirty: bool flag and only calls terminal.draw(...) when input arrives, the terminal resizes, a watcher event fires, threads.json changes on disk, an AgentResponse updates visible state, or a status notice expires. While idle in --watch mode, Lumiere consumes 0.0% CPU.

3. Lazy per-language Tree-sitter compilation (-61% baseline RSS, -52% startup)

Both diff::highlight::config and diff::context compile Tree-sitter HighlightConfiguration and scope Query objects lazily per language via OnceLock, instead of compiling all 16+ grammars at startup. Opening a Python repository only compiles the Python grammar, cutting small-repo peak RSS from 26.4 MB to 10.2 MB and startup time from 45.6 ms to 21.7 ms.

4. Cached ComputedDiff and branch name

ui::state::AppState caches the active file's ComputedDiff (paired side-by-side rows, hunk indices, LineStats, and max_old_width / max_new_width) and the repository's current branch name. Per-frame rendering, footer statistics, and horizontal scroll clamping are O(1) instead of rescanning hundreds of thousands of lines or invoking VCS lookups on every draw.

5. Batched VCS tree reads (-17% on 300-file repos)

VcsBackend::get_files_content_at_ref resolves the Git revision tree once per batch rather than parsing the revision and peeling to a commit/tree for every single changed file. On a 300-file diff, this avoids 299 redundant revparse_single lookups.

6. Large-file threshold (>1 MB) and zero-alloc hot paths

  • Files exceeding 1 MB skip full-file Tree-sitter parsing and scope extraction (AppState::current_file_is_too_large_to_parse), falling back to fast single-line highlighting of visible rows only while showing a large file: colours are approximate notice.
  • diff::context::extract_line scans bytes directly to the target line in O(line length) instead of collecting every line of a 360k-line file into a Vec<&str>.
  • ui::views::sidebar checks directory path prefixes without heap-allocating format!("{dir}/") strings on every render pass.
  • ui::input coalesces consecutive buffered mouse wheel events before scrolling and redrawing once.

7. Gitignore-aware watch startup on Linux (-42% to -56% --watch startup)

On Linux, diff::watcher installs non-recursive inotify watches only on non-gitignored directories (plus .git/ metadata for commits/checkouts) instead of walking .venv/ or node_modules/. Adding 8,000 gitignored directories adds just ~4 ms to --watch startup.

8. Release build profile

Cargo.toml configures [profile.release] with lto = "thin", codegen-units = 1, and strip = "symbols", and trims unused git2 features (https / vendored-openssl, which Lumiere never calls because remote operations go through gh).

Contributing & Testing

Lumiere aims for beauty by simplicity: clear primitives, direct control flow, zero unsafe code, and fast, durable tests.

Local development workflow

# Check formatting (configured in rustfmt.toml)
cargo fmt --all -- --check

# Lint with warnings denied across both feature sets
cargo clippy --all-targets -- -D warnings
cargo clippy --no-default-features --all-targets -- -D warnings

# Run the full test suite (Git + Jujutsu, and Git-only)
cargo test
cargo test --no-default-features

# Build an optimized release binary (LTO + single codegen unit + stripped symbols)
cargo build --release

Testing philosophy

Lumiere's tests focus on durable user-visible behavior and real invariants rather than internal implementation details:

  • Isolated temporary repositories: VCS, diff loading, watcher, workspace, and thread-store tests use tempfile::TempDir and pass explicit paths instead of mutating global working directories.
  • Headless TUI rendering with ratatui::backend::TestBackend: Diff rendering (side-by-side, added/deleted single-panel, binary, hunks-only folding, inline thread overlays, stacked headers, narrow footers, and Thread View modals) is tested directly against rendered terminal cell buffers.
  • Headless event-loop tests: App::handle_event returns LoopAction and operates cleanly without a TTY, letting tests drive multi-step keystroke and mouse workflows (commenting, queueing, global search jumping into hidden lines, async AgentWorker picker updates, and scroll coalescing).
  • Concurrency & UTF-8 regression coverage: Multi-threaded ThreadStore lock/rename stress tests, Unicode char-boundary tests for search/selection/truncation, and serde GraphQL fixture tests protect subtle edge cases.
  • Jujutsu integration tests: Tests requiring the external jj binary automatically skip when jj is not installed in PATH.

Previewing the documentation website

This documentation site is built with mdBook.

# Install mdBook once
cargo install mdbook

# Serve locally with live reload
mdbook serve docs --open

# Build static HTML into docs/book/
mdbook build docs

Merging changes to docs/** on main automatically builds and deploys the site to GitHub Pages via .github/workflows/docs.yml.

Continuous Integration & Releases

  • .github/workflows/ci.yml runs cargo fmt --check, cargo clippy -- -D warnings (default and --no-default-features), cargo test on both ubuntu-latest and macos-latest, and an MSRV check on Rust 1.89.
  • .github/workflows/dependency-review.yml runs GitHub Dependency Review on pull requests (failing on moderate or higher advisories).
  • .github/workflows/security-audit.yml runs a daily scheduled RustSec audit (cargo-audit) across all dependencies in Cargo.lock and opens issues on new advisories.
  • .github/workflows/lint-pr-title.yml enforces Conventional Commit PR titles so Release Drafter can classify changes automatically.
  • .github/workflows/docs.yml builds the mdBook site on PRs and deploys to GitHub Pages on main.
  • .github/workflows/release-drafter.yml (configured in .github/release-drafter.yml) auto-labels PRs (breaking, feature, fix, chore) and maintains a draft GitHub Release on main with 0.x semantic versioning (breaking and feat bump minor; fix and chore bump patch).
  • .github/workflows/release.yml triggers when a GitHub Release is published (or via workflow_dispatch with a release tag), builds Linux (x86_64) and macOS (aarch64, x86_64) binaries with LUMIERE_VERSION stamped from the tag, and uploads checksummed tarballs to that release.