try
try copied to clipboard
Add GH_PATH support for GitHub-specific repository organization
Summary
- Add
GH_PATHenvironment variable support for organizing GitHub repositories in$GH_PATH/<owner>/<repo>structure (e.g.,~/github/tobi/try) - Implement source switching in TUI with
Ctrl-Gto toggle between tries and GitHub sources
$ ~/github tree
.
├── miguelalcalde
│ ├── ecomm-dummy
│ ├── personal-crm-app
│ ├── tech-shop
├── mikemajara
│ ├── go-link-tree
│ ├── notion-cms
│ ├── test-repo-1
│ ├── test-repo-2
│ └── test-repo-3
└── tobi
└── try
Changes
New Feature: GH_PATH Support
When GH_PATH is set:
- GitHub repositories are cloned to
$GH_PATH/<owner>/<repo>instead of date-prefixed directories - If the directory already exists, just
cds into it without re-cloning - TUI displays GitHub repositories with
owner/repoformat (e.g.,toby/try)
TUI Enhancements
- Ctrl-G: Toggle between sources (All → Tries only → GitHub only)
- Header shows current source indicator:
(Tries + GitHub),(Tries only), or(GitHub only) - "Create new" option is disabled when viewing GitHub-only source
Delete Safety Validation
- Items from tries source validate against
TRY_PATH - Items from GitHub source validate against
GH_PATH - Delete script now uses absolute paths to support mixed deletions
Test Plan
- [ ] Set
GH_PATH=~/githuband clone a GitHub repo:try clone https://github.com/user/repo - [ ] Verify repo is created at
~/github/user/repo - [ ] Launch TUI and press
Ctrl-Gto cycle through source filters - [ ] Verify GitHub repos display as
owner/repoformat - [ ] Test deleting a GitHub repo with
Ctrl-D→ typeYES - [ ] Test deleting items from both sources in a single operation
- [ ] Verify clone skips if directory already exists when using
GH_PATH