Skip to content

Conversation

@gmatheu
Copy link

@gmatheu gmatheu commented Dec 16, 2025

Content of this PR (code and description) was purely generated with AI (opencode w/ Grok Code Fast 1)


This PR adds comprehensive package management capabilities to eget, including package tracking, bulk upgrades, and interactive selection.

📦 Feature 1: Installed Packages Tracking
Store installation metadata in ~/.eget.installed.toml

  • Records per-package info: repo, target, installation timestamp, download URL, asset, extracted files, options used
  • Tracks version info: Captures tag/version from GitHub API when available
  • Enhanced --list-installed: Shows comprehensive package information with current versions
  • Smart updates: Records are automatically updated when packages are reinstalled
    Files changed:
  • installed.go - New data structures and tracking functions
  • flags.go - Added version tracking fields
  • eget.go - Integrated recording into installation flow

🔄 Feature 2: --upgrade-all Flag
Bulk upgrade all installed packages with newer versions

  • Smart version detection: Uses existing GitHub API integration to check for updates
  • Timestamp-based comparison: Leverages release dates for reliable upgrade detection
  • Comprehensive reporting: Shows upgrade status for each package (upgrade/skip/error)
  • Dry-run support: --upgrade-all --dry-run shows what would be upgraded without changes
  • Error resilience: Continues with remaining packages if individual upgrades fail
    Files changed:
  • installed.go - Added upgrade checking and bulk upgrade logic
  • flags.go - Added --upgrade-all and --dry-run flags
  • eget.go - Integrated upgrade flow into main command handling

🎯 Feature 3: --interactive Flag
Beautiful interactive package selection using Bubbletea

  • Terminal UI: Multi-select interface with checkboxes and keyboard navigation
  • Rich controls:
    • ↑/↓ or j/k: navigate
    • Space: toggle selection
    • a: select all, n: select none
    • ctrl+d/enter: confirm, q/esc: quit
  • Smart environment detection: Automatically falls back to non-interactive mode when not in a proper terminal
  • Bubbletea integration: Uses Charm's Bubbletea library directly (no external gum dependency)
  • Seamless experience: Works with --dry-run for previewing interactive selections
    Files changed:
  • go.mod - Added github.com/charmbracelet/bubbletea dependency
  • installed.go - Complete Bubbletea model for interactive selection
  • flags.go - Added --interactive flag
  • eget.go - Integrated interactive parameter into upgrade flow
    🔧 Technical Implementation
    Key Design Decisions:
  • TOML-based storage: Uses existing TOML format for consistency
  • Backward compatibility: All existing functionality preserved
  • Graceful degradation: Features work in automated environments
  • Error resilience: Individual failures don't break bulk operations
    Dependencies Added:
  • github.com/charmbracelet/bubbletea v1.3.10 - For interactive UI
    🧪 Testing
    All features have been tested with:
  • ✅ Package installation tracking and listing
  • ✅ Bulk upgrade functionality with dry-run
  • ✅ Interactive selection with terminal detection
  • ✅ Fallback behavior in non-interactive environments
  • ✅ Error handling and recovery
  • ✅ Backward compatibility verification
    📚 Usage Examples

List all installed packages with details

eget --list-installed

Upgrade all packages with newer versions

eget --upgrade-all

Preview what would be upgraded

eget --upgrade-all --dry-run

Interactively select packages to upgrade

eget --upgrade-all --interactive

Preview interactive selections

eget --upgrade-all --interactive --dry-run
🔒 Breaking Changes
None. All features are additive and maintain full backward compatibility.

This PR significantly enhances eget's package management capabilities, making it much more user-friendly for managing multiple installed tools. The interactive selection provides a beautiful terminal experience, while the bulk upgrade functionality saves time for users with many packages.

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