Skip to content

github setup

GitHub Actions edited this page Jan 26, 2026 · 1 revision

GitHub CLI Setup

This guide explains how to set up GitHub CLI (gh) with the AI Agent Kit project.

Installation

Windows

Run the PowerShell script:

.\scripts\install-github-cli.ps1

IMPORTANT: After installation, you must restart your terminal/IDE for the gh command to be available in the PATH. The installation succeeds but the command won't be recognized until you restart your terminal.

Or install manually:

  1. Download from GitHub CLI releases
  2. Run the Windows x64 MSI installer
  3. Restart your terminal

Linux

Run the shell script:

./scripts/install-github-cli.sh

macOS

Install via Homebrew:

brew install gh

Authentication

After installation, authenticate with GitHub:

gh auth login

Follow the prompts to:

  1. Select GitHub.com (or GitHub Enterprise if applicable)
  2. Choose HTTPS as the preferred protocol
  3. Authenticate with your web browser
  4. Complete the authentication process

Configuration in AI Agent Kit

The project includes GitHub CLI integration through MCP (Model Context Protocol). The configuration is in .ai-agents/config/mcp.json:

"github": {
  "type": "stdio",
  "command": "gh",
  "args": ["mcp-server"],
  "env": {
    "GITHUB_TOKEN": "${GITHUB_TOKEN}"
  },
  "description": "GitHub CLI integration for repository management, issues, and PRs"
}

Environment Variables

Set the GITHUB_TOKEN environment variable for automatic authentication:

Windows (PowerShell)

$env:GITHUB_TOKEN = "your_token_here"
# Or add to profile for persistence:
echo '$env:GITHUB_TOKEN = "your_token_here"' >> $PROFILE

Linux/macOS

export GITHUB_TOKEN="your_token_here"
# Or add to ~/.bashrc or ~/.zshrc for persistence:
echo 'export GITHUB_TOKEN="your_token_here"' >> ~/.bashrc

Available Features

Once configured, you can use GitHub CLI features through the AI Agent Kit:

  • Repository management
  • Issue tracking and creation
  • Pull request operations
  • Release management
  • GitHub Actions workflows
  • Code review automation

Testing Installation

Verify the installation works:

gh --version
gh auth status

Note: If you get "command not found" errors, restart your terminal and try again. This is normal after installation on Windows.

Troubleshooting

Common Issues

  1. Command not found: Restart your terminal after installation - this is required on Windows for the PATH to update
  2. "gh: The term 'gh' is not recognized": This is the same issue - restart your IDE/terminal
  3. Authentication failed: Run gh auth login again
  4. Permission denied: Ensure your GitHub token has the necessary scopes

Getting Help

Integration with AI Agent Kit

The GitHub CLI integration allows AI agents to:

  • Create and manage repositories
  • Handle issues and pull requests
  • Interact with GitHub APIs
  • Automate CI/CD workflows
  • Generate code reviews

This enables powerful automation capabilities for development workflows.

Clone this wiki locally