How hamid-faridafshar/worktree works
Worktree is a terminal UI for finding repositories, managing Git worktrees, and opening a selected worktree in an editor. The main flow starts with the CLI entry point, scans repository directories, presents worktree actions, then creates/removes worktrees or launches Cursor. README also describes configurable IDE preferences and workspace-file handling; workspace copying is visible in the sampled utility code, but no settings implementation appears in the supplied tree. The graph omits that unsupported subsystem and shows only evidenced wiring.
Main entry points: utils.go Filesystem and Git helpers · main.go CLI entry · layout.go Terminal UI
Components 9
Entry and UI
- CLI entry
main.go - Terminal UI
internal/layout/layout.go
Repository operations
- Filesystem and Git helpers
internal/utils/utils.go
External tools
- Git
- Cursor
Other components
- Terminal user
- Repository directories
- Worktree directories
- Workspace file
Connections 8
- Terminal user → CLI entry: launches
- CLI entry → Terminal UI: creates UI
- Terminal UI → Filesystem and Git helpers: scans and acts
- Filesystem and Git helpers → Repository directories: lists and checks
- Filesystem and Git helpers → Worktree directories: creates and removes
- Filesystem and Git helpers → Workspace file: copies
- Filesystem and Git helpers → Git: runs worktree commands
- Filesystem and Git helpers → Cursor: launches