try icon indicating copy to clipboard operation
try copied to clipboard

Add GH_PATH support for GitHub-specific repository organization

Open miguelalcalde opened this issue 1 month ago • 0 comments

Summary

  • Add GH_PATH environment variable support for organizing GitHub repositories in $GH_PATH/<owner>/<repo> structure (e.g., ~/github/tobi/try)
  • Implement source switching in TUI with Ctrl-G to 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/repo format (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=~/github and clone a GitHub repo: try clone https://github.com/user/repo
  • [ ] Verify repo is created at ~/github/user/repo
  • [ ] Launch TUI and press Ctrl-G to cycle through source filters
  • [ ] Verify GitHub repos display as owner/repo format
  • [ ] Test deleting a GitHub repo with Ctrl-D → type YES
  • [ ] Test deleting items from both sources in a single operation
  • [ ] Verify clone skips if directory already exists when using GH_PATH

miguelalcalde avatar Dec 12 '25 16:12 miguelalcalde