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

# GitLab Self-Managed

> Connect self-managed GitLab instances to Blitzy for AI-Native code generation

GitLab Self-Managed integration lets Blitzy access repositories on your own GitLab instance for code analysis, branch creation, and commits.

## Setup

<Steps>
  <Step title="Open Integrations">
    Navigate to **Settings > Integrations** in your Blitzy dashboard.
  </Step>

  <Step title="Start connection">
    Click **Connect** on **GitLab Self-Managed**. You will be redirected to GitLab to authorize the Blitzy application.
  </Step>

  <Step title="Authorize">
    Click **Install & Authorize** to complete the connection.
  </Step>
</Steps>

### Granting Repository Access

1. Navigate to **Preferences > User Settings > Applications** in your GitLab instance
2. Click **Add new application** at the top right corner of **Your applications**
3. Fill out your **Name** and the **Redirect URI:**

```
https://platform.api.blitzy.com/v1/gitlab_sh/auth/success
```

4. Select the GitLab configuration
5. Click **Save**

## Permissions

The Blitzy GitLab App requires the following permissions, scoped to the minimum level needed.

| Permission         | Access Level | Purpose                                                                               |
| ------------------ | ------------ | ------------------------------------------------------------------------------------- |
| `api`              | Read & Write | Access groups, projects, container registry, dependency proxies, and package registry |
| `read_api`         | Read         | Read groups, projects, and registries                                                 |
| `write_repository` | Write        | Create branches and push generated code                                               |
| `read_user`        | Read         | Retrieve user identity for pull request attribution                                   |

### Permission Mapping Reference

| Operation            | Required Scope     | GitLab API         |
| -------------------- | ------------------ | ------------------ |
| Clone repository     | `read_api`         | Repositories API   |
| Create branch        | `write_repository` | Branches API       |
| Push commits         | `write_repository` | Commits API        |
| Create merge request | `api`              | Merge Requests API |
| List projects        | `read_api`         | Projects API       |
| Read user identity   | `read_user`        | Users API          |

## Organization Repositories

Organization admins must install and approve the Blitzy GitLab App:

1. Verify you have admin access to the organization
2. Install the app (organization owners may need to approve)
3. Team members can then connect their accounts to access authorized repositories

For GitLab-specific troubleshooting (OAuth errors, permission issues, rate limits), see [Troubleshooting](/integrations/troubleshooting#gitlab-troubleshooting).
