MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / handleCheckGhCli

Function handleCheckGhCli

projects/electron/src/modules/code/git.ts:538–552  ·  view source on GitHub ↗

* Check if gh CLI is installed and authenticated. * Lightweight endpoint that only runs `gh auth status`.

()

Source from the content-addressed store, hash-verified

536 * Lightweight endpoint that only runs `gh auth status`.
537 */
538async 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

Callers 1

checkRuntimeGhCliFunction · 0.85

Calls 1

execCommandFunction · 0.90

Tested by

no test coverage detected