@oss-autopilot/core - v1.6.3
    Preparing search index...

    Function detectGitHubUsername

    • Detect the authenticated GitHub username via the gh CLI.

      Runs gh api user --jq '.login' asynchronously and validates the result against GitHub's username rules. Never throws — returns null on any failure (gh not installed, not authenticated, invalid output, etc.).

      Returns Promise<string | null>

      The GitHub username string, or null if detection fails

      const username = await detectGitHubUsername();
      if (username) {
      console.log(`Logged in as ${username}`);
      }