Skip to content

Conversation

@miguelalcalde
Copy link

@miguelalcalde miguelalcalde commented Dec 12, 2025

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

When deleting repositories from the GitHub source (GH_PATH), the safety
validation was incorrectly checking against the tries path (TRY_PATH)
instead of the GitHub path, causing deletion to fail with "Safety check
failed" errors.

Changes:
- Validate each item against its correct root based on :source field
  (:tries items validate against TRY_PATH, :github items against GH_PATH)
- Update script_delete to use absolute paths instead of cd + relative
  basename, enabling support for mixed deletions
- Update delete_spec.md to reflect new absolute path format

The fix maintains all safety guarantees while enabling deletion of GitHub
repositories when GH_PATH is configured.
@miguelalcalde miguelalcalde marked this pull request as draft January 15, 2026 17:07
@miguelalcalde miguelalcalde marked this pull request as ready for review January 15, 2026 17:11
@miguelalcalde miguelalcalde changed the title add new github logic when GH_PATH is set Add GH_PATH support for GitHub-specific repository organization Jan 15, 2026
@miguelalcalde miguelalcalde marked this pull request as draft January 20, 2026 14:15
@miguelalcalde
Copy link
Author

Turning to draft. need to review the conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant