Skip to content

feat: check for required dependencies (gh, git) on startup #15

@LudoLoops

Description

@LudoLoops

Issue

If user doesn't have gh or proper git setup, errors are confusing and come too late.

Problem

  • User runs tasky finish and gets: "gh pr merge: command not found"
  • No clear indication that gh is required
  • Setup errors appear at command time, not at startup

Solution

Add dependency check function:

func CheckDependencies() error {
    // Check git
    cmd := exec.Command("git", "--version")
    if err := cmd.Run(); err != nil {
        return fmt.Errorf("git not found: %w", err)
    }
    
    // Check gh (only if GitHub integration used)
    cmd = exec.Command("gh", "--version")
    if err := cmd.Run(); err != nil {
        return fmt.Errorf("gh CLI not found. Install it from: https://cli.github.com")
    }
    
    return nil
}

Call in main() or when first needed.

Benefits

  • Clear error messages
  • Early failure detection
  • Better onboarding experience

Impact

🟢 Low - UX improvement

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions