Skip to content

Conversation

@luqven
Copy link
Owner

@luqven luqven commented Dec 29, 2025

Summary

Add gh CLI detection and installation helpers to help users create PRs when none exist for a branch.

Changes

New file: src/gh_cli.rs

  • is_gh_installed() - Check if gh CLI is available
  • is_gh_authenticated() - Check if gh is logged in
  • install_instructions() - Platform-specific install commands (macOS/Linux/Windows)
  • suggest_create_pr() - Print gh pr create command with installation hints
  • prompt_create_pr() - Interactive PR creation prompt

Modified: src/lib.rs

  • Export new gh_cli module

Behavior

  • Gracefully handles non-TTY environments (CI)
  • Shows installation hints when gh is not installed
  • Shows auth hints when gh is installed but not authenticated
  • Interactive prompt when running in a terminal

Tests

3 unit tests for basic functionality.

Stacked PR Chain: smart-log

PR Title Merges Into
#35 feat: add stack discovery API -
#36 feat: add rate limit retry logic #35
#37 feat: add identifier detection and prompts #36
#38 👉feat: add gh CLI helpers #37
#39 feat: make log and status identifier optional with branch inference #38
#40 docs: update log and status documentation for smart defaults #39
#41 perf: optimize stack discovery with batch fetch #40
#42 perf: parallelize status check fetches #41

Add src/gh_cli.rs module for GitHub CLI detection and installation
hints to help users create PRs when none exist for a branch.

New functions:
- is_gh_installed(): Check if gh CLI is available
- is_gh_authenticated(): Check if gh is logged in
- install_instructions(): Platform-specific install commands
- suggest_create_pr(): Print gh pr create command with hints
- prompt_create_pr(): Interactive PR creation prompt

The module handles non-TTY environments gracefully and provides
helpful messages when gh is not installed or not authenticated.

Includes 3 unit tests.
@luqven
Copy link
Owner Author

luqven commented Dec 30, 2025

Landed via #42

@luqven luqven closed this Dec 30, 2025
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.

2 participants