> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerotwo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Integration

> Connect GitHub to ZeroTwo for AI-powered repository management, code review, and issue tracking

The GitHub integration connects ZeroTwo to your GitHub repositories via Model Context Protocol (MCP), enabling you to manage code, issues, pull requests, and more through natural language.

## What you can do

<CardGroup cols={2}>
  <Card title="Browse repositories" icon="code-branch">
    Search and explore your GitHub repositories and code
  </Card>

  <Card title="Manage issues" icon="circle-exclamation">
    Create, update, and track issues and bug reports
  </Card>

  <Card title="Review pull requests" icon="code-pull-request">
    Analyze PRs, review code changes, and manage reviews
  </Card>

  <Card title="Commit and push" icon="code-commit">
    Make commits and push changes through AI assistance
  </Card>
</CardGroup>

## Connecting GitHub

<Steps>
  <Step title="Open integrations">
    Settings → Integrations → GitHub
  </Step>

  <Step title="Authorize">
    Connect your GitHub account and grant permissions.

    **Permissions requested:**

    * Read repository contents
    * Create and manage issues
    * Create and review pull requests
    * Commit and push code (optional)
    * Manage repository settings (optional)
  </Step>

  <Step title="Select repositories">
    Choose which repositories to grant access to.
  </Step>

  <Step title="Confirm">
    <Check>
      GitHub integration is active via MCP.
    </Check>
  </Step>
</Steps>

<Info>
  This integration uses the Model Context Protocol for secure GitHub access. Learn more about [MCP](/integrations/mcp-overview).
</Info>

## Using GitHub

### Repository operations

```text theme={null}
"List all my GitHub repositories"
"Show recent commits in the main branch"
"Find files containing 'authentication' in the API repo"
"Display the README from my project repository"
```

### Issue management

<CodeGroup>
  ```text Create issues theme={null}
  "Create a GitHub issue: Fix login button styling"
  "Open an issue about the API timeout error with details"
  "Create a bug report for the broken navigation menu"
  ```

  ```text Search issues theme={null}
  "Find open issues assigned to me"
  "Show all high-priority bugs in the project"
  "List issues created this week"
  ```

  ```text Update issues theme={null}
  "Close issue #123 with a comment explaining the fix"
  "Add label 'enhancement' to issue #45"
  "Assign issue #67 to alice"
  ```
</CodeGroup>

### Pull requests

<Tabs>
  <Tab title="Create PRs">
    ```text theme={null}
    "Create a pull request from feature-branch to main"
    "Open a PR for my latest commits with title 'Add user authentication'"
    "Create a draft PR for the API refactoring"
    ```
  </Tab>

  <Tab title="Review PRs">
    ```text theme={null}
    "Review pull request #89 and summarize the changes"
    "What files changed in PR #45?"
    "Analyze the code quality in the latest PR"
    ```
  </Tab>

  <Tab title="Manage PRs">
    ```text theme={null}
    "Merge pull request #78"
    "Add a review comment to PR #56 about the error handling"
    "Request changes on PR #34 regarding the tests"
    ```
  </Tab>
</Tabs>

### Code operations

```text theme={null}
"Read the contents of src/auth/login.js"
"Show me the recent changes to the database schema"
"Find all TypeScript files in the components directory"
"Display the git history for the main branch"
```

## Advanced features

### Code analysis

```text theme={null}
"Analyze the code in PR #45 for potential security issues"
"Review the recent commits for code quality"
"Find TODO comments across the repository"
```

### Branch management

```text theme={null}
"List all branches in the repository"
"Create a new branch called feature-user-profiles"
"Show differences between main and develop branches"
```

### Repository insights

```text theme={null}
"Show repository statistics and activity"
"Who are the top contributors this month?"
"What files have changed most frequently?"
```

### Automation

```text theme={null}
"Create issues for all TODO comments in the codebase"
"Generate a changelog from commits since last release"
"Check if CI/CD is passing for the latest commits"
```

## Workflows

### Bug triage

```text theme={null}
1. "Show me all unassigned bug reports"
2. "Analyze bug #123 and suggest potential causes"
3. "Assign bug #123 to the backend team with priority label"
```

### Code review

```text theme={null}
1. "List all open pull requests awaiting review"
2. "Review PR #45 and check for security concerns"
3. "Add review comments and approve if tests pass"
```

### Release preparation

```text theme={null}
1. "List all closed issues since last release"
2. "Generate release notes from recent merges"
3. "Create a release checklist issue"
```

## Privacy and permissions

<Info>
  **Access scope:**

  * Only repositories you explicitly grant access to
  * Code and issues accessed only when requested
  * No repository data stored permanently
  * GitHub tokens encrypted and securely stored

  **Permission levels:**

  * **Read**: View code, issues, and PRs
  * **Write**: Create issues and PRs, comment
  * **Admin**: Manage repository settings (optional)
</Info>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Repository access denied">
    **Solutions:**

    * Verify you granted access to the specific repository
    * Check your GitHub account permissions for the repo
    * Reconnect integration if permissions changed
    * For organization repos, ensure the integration is approved
  </Accordion>

  <Accordion title="Can't create issues or PRs">
    **Solutions:**

    * Confirm write permissions are granted
    * Check repository settings allow issue creation
    * Verify you're not in read-only mode
    * Ensure branch protection rules don't block your action
  </Accordion>

  <Accordion title="Sync delays">
    **Solutions:**

    * GitHub API may have brief caching delays
    * Wait 1-2 minutes for recent changes to appear
    * Refresh the integration connection
    * Check GitHub's status page for API issues
  </Accordion>
</AccordionGroup>

## Use cases

### Development workflow

```text theme={null}
"Create an issue for the new feature, then create a branch and PR for it"
```

### Code review assistant

```text theme={null}
"Review all my open PRs and summarize what needs attention"
```

### Project management

```text theme={null}
"Show sprint progress: how many issues are complete vs in progress?"
```

### Documentation

```text theme={null}
"Generate API documentation from the source code comments"
```

## Related integrations

<CardGroup cols={3}>
  <Card title="Linear" icon="diagram-project" href="/integrations/linear">
    Issue tracking
  </Card>

  <Card title="Notion" icon="note-sticky" href="/integrations/notion">
    Documentation
  </Card>

  <Card title="MCP overview" icon="plug" href="/integrations/mcp-overview">
    Learn about MCP
  </Card>
</CardGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Custom extensions" icon="puzzle-piece" href="/tools/custom-extensions">
    Build custom GitHub workflows
  </Card>

  <Card title="Code interpreter" icon="terminal" href="/tools/code-interpreter">
    Run and test code
  </Card>
</CardGroup>
