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

# GitHub Enterprise

> Integrate CodeAnt with your self-hosted GitHub Enterprise Server for AI-powered code analysis

<Note>
  This guide requires administrative access to your GitHub Enterprise Server instance.
</Note>

## Overview

CodeAnt seamlessly integrates with GitHub Enterprise Server to provide intelligent code analysis, automated reviews, and security insights for your private enterprise repositories. This comprehensive guide walks you through the complete setup process.

## What you'll need

<CardGroup cols={2}>
  <Card title="GitHub Enterprise Admin Access" icon="shield-check">
    Administrative privileges to create OAuth Apps and GitHub Apps
  </Card>

  <Card title="CodeAnt Account" icon="user-check">
    Active organization account with setup permissions
  </Card>
</CardGroup>

## Setup

### Step 1: Set up OAuth Authentication

Using your administrator account, navigate to your GitHub Enterprise Server settings and create a new OAuth App with these configurations:

<Info>This OAuth App enables secure user authentication between GitHub Enterprise Server and CodeAnt AI.</Info>

<ParamField body="application_name" type="string" required>
  CodeAnt OAuth
</ParamField>

<ParamField body="homepage_url" type="url" required>
  [https://codeant.ai](https://codeant.ai)
</ParamField>

<ParamField body="description" type="string">
  OAuth application for authenticating with CodeAnt's intelligent code analysis platform
</ParamField>

<ParamField body="callback_url" type="url" required>
  [https://app.codeant.ai](https://app.codeant.ai)
</ParamField>

<Warning>
  Save your Client ID and Client Secret immediately - the secret won't be shown again!
</Warning>

### Step 2: Configure GitHub App Integration

Create a GitHub App to enable CodeAnt's repository access and webhook functionality.

<Info>GitHub Apps provide more granular permissions and better security than OAuth Apps for repository operations.</Info>

1. Navigate to **Settings** → **Developer settings** → **GitHub Apps**
2. Click **New GitHub App**

<Tabs>
  <Tab title="Basic Information">
    Configure the basic app settings with these details:

    | Field                                                      | Value                     |
    | ---------------------------------------------------------- | ------------------------- |
    | **GitHub App name**                                        | `CodeAnt`                 |
    | **Description**                                            | `GitHub App for CodeAnt`  |
    | **Homepage URL**                                           | `https://codeant.ai`      |
    | **Callback URL**                                           | `https://app.codeant.ai/` |
    | **Request user authorization (OAuth) during installation** | ✓ Enabled                 |
    | **Where can this GitHub App be installed?**                | Any account               |
  </Tab>

  <Tab title="Webhook Configuration">
    Set up webhook for real-time code analysis:

    | Field            | Value                                                    |
    | ---------------- | -------------------------------------------------------- |
    | **Webhook URL**  | `https://github.codeant.ai/webhooks`                     |
    | **Content Type** | `application/json`                                       |
    | **Secret**       | Generate a secure webhook secret (minimum 32 characters) |
  </Tab>

  <Tab title="Permissions">
    Configure the required permissions for the GitHub App:

    **Repository Permissions:**

    * **Administration**: Read-only
    * **Checks**: Read and write
    * **Commit statuses**: Read and write
    * **Contents**: Read and write
    * **Deployments**: Read-only
    * **Issues**: Read and write
    * **Metadata**: Read-only (Mandatory)
    * **Pull requests**: Read and write
    * **Webhooks**: Read-only

    **Organization Permissions:**

    * **Administration**: Read-only
    * **Members**: Read-only

    **Account Permissions:**

    * **Profile**: Read and write
  </Tab>

  <Tab title="Event Subscriptions">
    Subscribe to the following events:

    * `issue_comment`
    * `issues`
    * `pull_request`
    * `pull_request_review`
    * `pull_request_review_comment`
  </Tab>
</Tabs>

3. Click **Create GitHub App**

**Generate app credentials:**

After creating the GitHub App, you'll need to generate and save:

* **Client Secret**: Generate a new client secret
* **Private Key**: Generate and download the PEM file
* **Webhook Secret**: Generate a secure webhook secret
* Note the **App ID** and **Client ID**

**Credentials checklist:**

* ✅ App ID
* ✅ Client ID
* ✅ Client secret
* ✅ Webhook secret
* ✅ Private key (PEM file)

### Step 3: Connect to CodeAnt AI

Now link your GitHub Enterprise Server to CodeAnt AI using the credentials you've created.

1. Navigate to [app.codeant.ai](https://app.codeant.ai)
2. Select **Self-Hosted** option
3. Choose **Self-Hosted GitHub** as your provider
4. Provide the following information from your GitHub Enterprise setup:

* **Base URL**: Your GitHub Enterprise Server URL (e.g., `https://github.yourcompany.com`)
* **OAuth Client ID**: The Client ID from your OAuth App
* **OAuth Client Secret**: The Client Secret from your OAuth App
* **GitHub App ID**: The App ID from your GitHub App
* **GitHub App Private Key**: The Private Key (PEM format) from your GitHub App
* **Webhook Secret**: The Webhook Secret you generated

5. Click **Submit** to save the configuration

### Step 4: Activate Repository Access

Install the CodeAnt GitHub App to grant access to your repositories.

1. Navigate to your GitHub Enterprise Server settings
2. Go to **GitHub Apps** → **CodeAnt**
3. Click **Install App**
4. Select the repositories you want CodeAnt to analyze
5. Click **Install**

<Tip>Start with a few test repositories, then expand to your full organization once everything is working smoothly.</Tip>

### Step 5: Finalize Your Setup

Complete the authentication flow to start analyzing your code.

1. Return to the self-hosted options in CodeAnt AI
2. Select **Self-Hosted GitHub** again
3. Click **Login** and enter your GitHub Enterprise Server base URL when prompted
4. You'll be redirected to your GitHub Enterprise Server for authentication
5. After successful authentication, you should see your repositories in CodeAnt AI

<Check>Success! Your GitHub Enterprise Server is now connected to CodeAnt AI.</Check>

## Network Configuration

### IP Allowlisting

If your instance requires IP allowlisting, add these CodeAnt IP addresses to your firewall:

```
3.110.247.111/32
```

Need help? Contact our support team or check our troubleshooting guide for common setup issues.
