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

# GitHub

> Let agents browse repositories, issues, and pull requests — and file work where you allow it

Connect GitHub and your agents can answer questions about your code work without anyone leaving the conversation: what's open, what's stuck, what shipped. They can also file issues and leave comments — with a human approving first, by default.

## What agents can do

| Capability                          | Details                                             |
| ----------------------------------- | --------------------------------------------------- |
| List organizations and repositories | Everything visible to the connected account.        |
| Read repository details             | Default branch, visibility, language, links.        |
| List branches                       | Branch names and latest commits.                    |
| List and read issues                | Filterable; full issue detail by number.            |
| List and read pull requests         | State, branches, author, review and comment counts. |
| Create issues                       | File a new issue in a repository.                   |
| Comment on issues and PRs           | Visible to everyone in the repository.              |

Reading runs freely by default. Creating issues asks for approval by default, and comments — visible collaboration — do too. See [Permissions](#permissions).

## Try asking

* *"What pull requests are open in acme/webapp and who's waiting on review?"*
* *"Summarize the discussion on issue #482."*
* *"Which issues were closed in acme/api this week?"*
* *"File an issue in acme/webapp: the export button 500s for large workspaces. Include what we found in this conversation."* — created after approval.
* *"Comment on PR #91 asking for a changelog entry."* — posted after approval.

## Connect GitHub

<Steps>
  <Step title="Open Integrations">
    In the Leme dashboard, go to **Integrations** and select **GitHub**.
  </Step>

  <Step title="Authorize on GitHub">
    Select **Connect** and approve on GitHub's consent screen with the account whose access agents should have.
  </Step>

  <Step title="Enable it on your agents">
    Attach the connection to the agents that should use it and review **Agent permissions**.
  </Step>
</Steps>

GitHub is a **shared** connection: agents see exactly what the connected account can see. Connect with an account whose repository access matches what you want agents to reach — many teams use a dedicated machine account for this.

<Note>
  If your organization restricts OAuth apps, an org owner may need to approve Leme before organization repositories become visible. This is a GitHub-side setting: **Organization settings → Third-party access**.
</Note>

## Permissions

| Action                                     | Category               | Default      |
| ------------------------------------------ | ---------------------- | ------------ |
| List and read repos, branches, issues, PRs | Read                   | Allow        |
| Create issues                              | Write                  | Ask approval |
| Comment on issues and PRs                  | External communication | Ask approval |

Adjust in **Integrations → GitHub → Agent permissions** — see [Permissions & approvals](/permissions). If issue filing becomes routine, you can allow just that action while keeping comments behind approval.

## Troubleshooting

<AccordionGroup>
  <Accordion title="The agent can't find a repository that exists">
    The connected account can't see it. Check the account's access to that repository — and for organization repos, check that your org has approved the Leme app under third-party access restrictions.
  </Accordion>

  <Accordion title="Organization repositories are missing, personal ones work">
    Almost always the org's OAuth app restriction. An organization owner needs to approve access for Leme on GitHub.
  </Accordion>

  <Accordion title="The connection stopped working after a while">
    The authorization expired or was revoked on GitHub (for example, the connecting user revoked the app, or left the organization). Reconnect from **Integrations → GitHub**.
  </Accordion>

  <Accordion title="An issue count looks off">
    GitHub's API counts pull requests as issues in some listings. Agents are told to distinguish the two, but if a number looks suspicious, ask the agent to list the items instead of the count.
  </Accordion>
</AccordionGroup>
