- Go 1.23+
- git (required for core functionality)
- jj (optional, for Jujutsu repository support)
- gh (GitHub CLI, optional for PR features)
# Build and run
go build -o gh-repo-dashboard .
./gh-repo-dashboard ~/Developer
# Or install as gh extension
gh extension install .
gh repo-dashboard ~/DeveloperRun all tests:
go test ./...Run with verbose output:
go test -v ./...Run specific package:
go test -v ./internal/filters/...Run specific test:
go test -v -run TestFilterRepos ./internal/filters/Run with coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.outRun with race detector:
go test -race ./...See test-improvements.md for comprehensive testing patterns:
- teatest (Golden File Testing) - Visual regression with snapshot comparison
- catwalk (Data-Driven Testing) - Complex interaction sequence testing
- Direct Testing - State transition and business logic testing
# Run golden file tests (if using build tag)
go test -tags=golden ./...
# Update golden files
go test -tags=golden -update ./...Generate demo GIF using VHS:
# Install VHS (if not already installed)
# macOS:
brew install vhs
# Other platforms:
# https://github.com/charmbracelet/vhs#installation
# Record the demo
vhs < .github/assets/demo.tapeThe demo will be saved as .github/assets/demo.gif.
Editing the demo:
- Edit
.github/assets/demo.tapeto change the recording script - Run
vhs < .github/assets/demo.tapeto regenerate - Commit both the tape file and generated GIF
VHS tips:
- Use
Set PlaybackSpeedto control animation speed - Use
Sleepbetween actions to let UI settle - Use
Hide/Showto hide setup commands - Use Catppuccin Macchiato theme to match app theme
See CLAUDE.md for detailed code style guidelines.
Key principles:
- Use interfaces for abstraction
- Write small, composable functions with single responsibility
- Return errors explicitly with context
- Use
context.Contextfor cancellation and timeouts - No inline comments explaining what code does
- Add doc comments for exported functions/types
See CLAUDE.md for detailed architecture documentation.
Key packages:
internal/app/- Bubble Tea app (Model, Update, View)internal/models/- Data structures (RepoSummary, BranchInfo, PRInfo)internal/filters/- Filter and sort logic with fuzzy searchinternal/vcs/- VCS abstraction (git and jj implementations)internal/github/- GitHub CLI integrationinternal/discovery/- Repository discoveryinternal/cache/- Generic TTL-based cachinginternal/batch/- Batch task runner
- Add const to
FilterModeininternal/models/enums.go - Add filter function in
internal/filters/filter.go - Add case to
FilterRepos()ininternal/filters/filter.go - Add tests in
internal/filters/filter_test.go
- Add key binding to
internal/app/keymap.go - Add case to key handling in
internal/app/update.go - Update help text in
internal/app/view.go - Add test in
internal/app/app_test.go
- Add const to
ViewModeininternal/app/app.go - Add view rendering in
internal/app/view.go - Add update handling in
internal/app/update.go - Add navigation logic (enter/exit)
- Add method to
VCSOperationsinterface ininternal/vcs/operations.go - Implement in both
GitOperationsandJJOperations - Create task function in
internal/batch/tasks.go - Add handler in
internal/app/update.go - Add keybinding to
internal/app/keymap.go - Add tests to
internal/batch/batch_test.go
- git - Core functionality depends on git CLI
-
jj (Jujutsu) - For jj repository support
- Install: See https://github.com/martinvonz/jj
-
gh (GitHub CLI) - PR features require this
- Install:
brew install gh(macOS) or see https://cli.github.com/
- Install:
# Run with debug output to stderr
./gh-repo-dashboard ~/Developer 2>debug.logTerminal size issues:
- Model receives
tea.WindowSizeMsgon startup and resize - Ensure width/height are updated in Update()
Message ordering:
- Commands execute asynchronously
- Don't assume message arrival order
- Use state flags to track loading/completion
Goroutine leaks:
- Use
context.Contextfor cancellation - Cancel contexts when leaving views or quitting
- Fuzzy search uses sahilm/fuzzy for efficient matching
- Progressive loading prevents blocking on initial scan
- TTL caching with mutex protection for thread safety
- Goroutines with Tea commands for parallel data loading
- Lipgloss style caching (reuse style objects)