> ## 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.

# Bitbucket

> Connect Bitbucket Cloud repositories to Blitzy for AI-Native code generation

export const ImageWrapper = ({src, alt, caption, width = '100%'}) => <Frame caption={caption}>
    <img src={src} alt={alt} style={{
  width: width,
  display: 'block'
}} />
  </Frame>;

Bitbucket Cloud integration lets Blitzy access your repositories to analyze code, create branches, push commits, and manage pull requests.

## Setup

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

  <Step title="Connect Bitbucket">
    Click **Connect** on **Bitbucket**. You will be redirected to Atlassian to authorize the application.
  </Step>

  <Step title="Authorize Blitzy">
    Review the requested permissions and click **Accept** to grant Blitzy access to your Bitbucket account.

    <ImageWrapper src="/images/bitbucket-oauth-consent.png" alt="Atlassian OAuth consent screen showing permissions requested by Blitzy" />
  </Step>

  <Step title="Choose sharing">
    After connecting, choose whether to keep the integration private (**Just me**) or make it available to your team (**Share with team**). Click **Done** to finish.
  </Step>
</Steps>

<Note>You can change the sharing setting later from **Settings > Integrations**. See [Managing Integrations](/integrations/managing) for details.</Note>

## Permissions

The Blitzy Bitbucket integration requires the following permissions, scoped to the minimum level needed.

| Permission            | Access Level | Purpose                                                 |
| --------------------- | ------------ | ------------------------------------------------------- |
| Account - Read        | Read         | Read your account information and primary email address |
| Account - Write       | Read & Write | Modify your account information                         |
| Projects - Read       | Read         | Read your workspace's project settings                  |
| Pull Requests - Read  | Read         | Read your pull requests                                 |
| Pull Requests - Write | Read & Write | Create and modify pull requests                         |
| Repositories - Read   | Read         | Clone and analyze your repositories                     |
| Repositories - Write  | Read & Write | Create branches and push commits                        |

### Permission Mapping Reference

| Operation           | Required Permission  | Bitbucket API     |
| ------------------- | -------------------- | ----------------- |
| Clone repository    | Repositories: Read   | Git-over-HTTPS    |
| Create branch       | Repositories: Write  | Refs API          |
| Push commits        | Repositories: Write  | Git-over-HTTPS    |
| Create pull request | Pull Requests: Write | Pull Requests API |
| List repositories   | Repositories: Read   | Repositories API  |
| Read user identity  | Account: Read        | User API          |

For Bitbucket-specific troubleshooting (OAuth errors, permission issues), see [Troubleshooting](/integrations/troubleshooting#bitbucket-issues).
