What's wrong with this entry?
What: GitHub CLI authentication detection now uses JSON output parsing for more reliable credential extraction.
How it works: The gh auth status command is now called with --active --json hosts flags, parsing structured JSON instead of text output. This improves reliability across different gh CLI versions and configurations.
Details:
- New function
Xi5()at line 426046 usesgh auth status --active --json hostsfor structured output - Parses JSON response to extract
hostsobject and active account login - Handles multiple GitHub hosts (github.com, Enterprise instances) by iterating through host entries
- Replaces old shell parsing approach that used
sh -c "gh auth status 2>&1 | head -n 1"and regex matching - Evidence:
Xi5() at line 426046-426076
Why it matters: More robust GitHub authentication detection prevents false negatives and works consistently across different GitHub CLI versions and Enterprise configurations.