* Check if gh CLI is installed and authenticated. * Lightweight endpoint that only runs `gh auth status`.
()
| 536 | * Lightweight endpoint that only runs `gh auth status`. |
| 537 | */ |
| 538 | async function handleCheckGhCli(): Promise<CheckGhCliResponse> { |
| 539 | const startTime = Date.now() |
| 540 | logger.info("[Git:checkGhCli] Checking gh CLI availability") |
| 541 | |
| 542 | let hasGhCli = false |
| 543 | try { |
| 544 | const ghResult = await execCommand("gh", ["auth", "status"], { timeout: 5000 }) |
| 545 | hasGhCli = ghResult.success |
| 546 | } catch { |
| 547 | // gh not installed or not in PATH |
| 548 | } |
| 549 | |
| 550 | logger.info("[Git:checkGhCli] Result", JSON.stringify({ hasGhCli, duration: Date.now() - startTime })) |
| 551 | return { hasGhCli } |
| 552 | } |
| 553 | |
| 554 | /** |
| 555 | * Check if directory is within a git repository and return repo info |
no test coverage detected