How itsjunk02/git-hud works
git-hud is a local-first desktop Git HUD: users open repositories, inspect history and working-tree state, make Git changes, resolve conflicts, and review collaboration signals. The React UI communicates with a Tauri command/event boundary; a Rust engine reads and writes repositories with libgit2, while SQLite caches derived data. Other documented capabilities include background fetch/CI polling and a PTY-backed terminal. Backend command-to-engine wiring and some background-worker details are only partially excerpted, so those links are marked unverified where needed.
Main entry points: App.tsx Application Shell · tauri-ipc.ts Typed IPC Client · lib.rs Tauri Command Surface · git.rs Git Repository Engine
Components 28
Workspace UI
- Application Shell
src/App.tsx - Project Sidebar
src/components/Sidebar.tsx - Workspace State
src/hooks/useWorkspace.ts - View Selection
src/lib/views.ts - Typed IPC Client
src/services/tauri-ipc.ts - IPC Bindings
src/services/bindings.ts
Git Views
- Commit Timeline
src/components/CommitTimeline.tsx - Commit Inspector
src/components/CommitDetail.tsx - Changes Panel
src/components/ChangesPanel.tsx - Conflict Editor
src/components/MergeConflictEditor.tsx - Collaboration Dashboard
src/components/CollaborationDashboard.tsx - Repository Settings
src/components/SettingsPanel.tsx - Terminal Session
src/components/TerminalSession.tsx
Rust Backend
- Tauri Command Surface
src-tauri/src/lib.rs - Git Repository Engine
src-tauri/src/engine/git.rs - Stage and Commit
src-tauri/src/engine/writes.rs - Conflict Resolution
src-tauri/src/engine/conflicts.rs - Git Data Models
src-tauri/src/engine/model.rs - Contributor and DCO Stats
src-tauri/src/engine/stats.rs - Remote and CI
src-tauri/src/engine/remote.rs - Review Metrics
src-tauri/src/engine/reviews.rs
Ambient Services
- Background Sync
src-tauri/src/engine/sync.rs - Repository Watcher
src-tauri/src/engine/watcher.rs - PTY Shell
src-tauri/src/engine/terminal.rs
Local State
- SQLite Cache
src-tauri/src/db/cache.rs
Other components
- User
- GitHub via gh
- System Shell
Connections 38
- User → Project Sidebar: selects projects
- Project Sidebar → Workspace State: manages workspace
src/App.tsx - Application Shell → Project Sidebar: renders
src/App.tsx - Application Shell → View Selection: selects views
src/App.tsx - Application Shell → Commit Timeline: renders
src/App.tsx - Application Shell → Commit Inspector: renders
src/App.tsx - Application Shell → Changes Panel: renders
src/App.tsx - Application Shell → Conflict Editor: renders
src/App.tsx - Application Shell → Collaboration Dashboard: renders
src/App.tsx - Application Shell → Repository Settings: renders
src/App.tsx - Application Shell → Terminal Session: renders
src/App.tsx - Workspace State → Typed IPC Client: calls commands
src/hooks/useWorkspace.ts - Commit Timeline → Typed IPC Client: loads Git data
src/components/CommitTimeline.tsx - Changes Panel → Typed IPC Client: stages and commits
src/components/ChangesPanel.tsx - Conflict Editor → Typed IPC Client: resolves conflicts
src/components/MergeConflictEditor.tsx - Collaboration Dashboard → Typed IPC Client: loads collaboration
src/components/CollaborationDashboard.tsx - Repository Settings → Typed IPC Client: accesses settings
src/components/SettingsPanel.tsx - Terminal Session → Typed IPC Client: controls PTY
src/components/TerminalSession.tsx - Typed IPC Client → IPC Bindings: invokes generated commands
src/services/tauri-ipc.ts - Typed IPC Client → Tauri Command Surface: sends typed IPC
README.md - Tauri Command Surface → Git Repository Engine: dispatches Git reads
- Tauri Command Surface → Stage and Commit: dispatches writes
- Tauri Command Surface → Conflict Resolution: dispatches resolutions
- Tauri Command Surface → Contributor and DCO Stats: serves statistics
- Tauri Command Surface → Remote and CI: serves remote status
- Tauri Command Surface → Review Metrics: serves review data
- Git Repository Engine → Git Data Models: produces Git models
src-tauri/src/engine/git.rs - Git Repository Engine → SQLite Cache: caches derived data
- Stage and Commit → Git Repository Engine: uses repository logic
src-tauri/src/engine/writes.rs - Conflict Resolution → Contributor and DCO Stats: uses blame attribution
src-tauri/src/engine/conflicts.rs - Remote and CI → GitHub via gh: queries forge APIs
README.md - Review Metrics → GitHub via gh: queries review API
src-tauri/src/engine/reviews.rs - Background Sync → Remote and CI: polls remote status
- Repository Watcher → Application Shell: emits change events
README.md - PTY Shell → System Shell: spawns PTY shell
README.md - Terminal Session → PTY Shell: streams PTY data
README.md - SQLite Cache → Git Data Models: stores commit records
src-tauri/src/db/cache.rs - SQLite Cache → Remote and CI: stores CI status
src-tauri/src/db/cache.rs