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

# GitHub Integration

> Connect GitHub to your Trilo workspace for AI-powered code collaboration

Connect GitHub to Trilo and let your AI coworkers help with code-related tasks. They can read repositories, create issues, review PRs, and keep your team informed about code changes.

## What AI Can Do with GitHub

Once connected, AI coworkers can:

| Capability               | Example Use                                      |
| ------------------------ | ------------------------------------------------ |
| **Read repositories**    | "What's the structure of our main repo?"         |
| **Search code**          | "Find all files that use the auth service"       |
| **Create issues**        | "Create an issue for the login bug we discussed" |
| **Read issues**          | "What are the open issues labeled 'urgent'?"     |
| **Create pull requests** | "Open a PR with these changes"                   |
| **Review PRs**           | "Summarize the changes in PR #42"                |
| **Track activity**       | "What was merged this week?"                     |

## Prerequisites

Before connecting GitHub:

* You need a GitHub account with access to the repositories you want to connect
* You must be a Trilo workspace admin (or have integration permissions)
* Your GitHub organization must allow OAuth apps (if connecting org repos)

## Connecting GitHub

<Steps>
  <Step title="Open Workspace Settings">
    Click **Settings** in the Trilo sidebar.
  </Step>

  <Step title="Go to Integrations">
    Select the **Integrations** section.
  </Step>

  <Step title="Find GitHub">
    In the workspace integrations list, find **GitHub** and click **Connect**.
  </Step>

  <Step title="Authorize with GitHub">
    You'll be redirected to GitHub. Sign in if needed and review the permissions.
  </Step>

  <Step title="Select Repositories">
    Choose which repositories Trilo can access:

    * **All repositories** - Access to all repos you have access to
    * **Selected repositories** - Choose specific repos
  </Step>

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

<Info>
  For organization repositories, you may need organization owner approval before the app can be installed.
</Info>

## Configuring Repository Access

After connecting, configure which projects can use GitHub:

<Steps>
  <Step title="Open a Project">
    Navigate to a project that needs GitHub access.
  </Step>

  <Step title="Go to Project Settings">
    Click the settings icon in the project header.
  </Step>

  <Step title="Select Integrations">
    Find the **Integrations** tab.
  </Step>

  <Step title="Add GitHub">
    Select the GitHub integration from available workspace integrations.
  </Step>

  <Step title="Choose Repositories">
    Select which repositories this project should have access to.
  </Step>
</Steps>

## Permissions Explained

| Permission                   | Why It's Needed                                    |
| ---------------------------- | -------------------------------------------------- |
| **Read code**                | To search code and understand repository structure |
| **Read issues**              | To list and search existing issues                 |
| **Write issues**             | To create issues from conversations                |
| **Read pull requests**       | To summarize and review PRs                        |
| **Write pull requests**      | To create PRs when requested                       |
| **Read repository metadata** | To list repos and branches                         |

## Using GitHub with AI Coworkers

### In Project Chat

Ask AI coworkers about your code:

```
You: What are the open bugs in our backend repo?
AI: I found 5 open issues labeled 'bug' in acme/backend...

You: Create an issue for the memory leak we discussed
AI: Created issue #234 "Memory leak in user service" with the details from our conversation.

You: Summarize the changes in this week's PRs
AI: This week had 12 merged PRs. The main changes include...
```

### In Tasks

When AI coworkers work on tasks, they can:

* Reference related GitHub issues
* Create issues for bugs discovered during work
* Link PRs to task completion

### In Workflows

Automated workflows can:

* Monitor repositories for new issues
* Get notified of PR merges
* Create tasks from GitHub issues

## Best Practices

<AccordionGroup>
  <Accordion title="Limit repository access per project">
    Don't give every project access to every repository. The marketing project doesn't need access to the infrastructure repo. This keeps AI focused on relevant context.
  </Accordion>

  <Accordion title="Use for issue creation, not code changes">
    AI coworkers are great at creating issues and summarizing code. For actual code changes, developers should push commits directly. AI can create PRs for simple changes if requested.
  </Accordion>

  <Accordion title="Keep sensitive repos separate">
    If you have repositories with secrets, credentials, or sensitive business logic, consider not connecting them. AI doesn't need access to everything.
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Can't see my organization's repositories">
    Your organization may need to approve the Trilo GitHub app. Ask an organization owner to approve it in **Organization Settings → Third-party Access**.
  </Accordion>

  <Accordion title="AI says it can't access a repository">
    Check that:

    1. The repository is included in your GitHub app installation
    2. The repository is assigned to the project you're chatting in
    3. Your personal GitHub permissions include that repository
  </Accordion>

  <Accordion title="Integration shows as disconnected">
    The OAuth token may have expired. Click **Reconnect** in Trilo's integration settings to re-authorize.
  </Accordion>

  <Accordion title="Can't create issues or PRs">
    Verify that the GitHub app has write permissions. If you selected read-only during setup, you'll need to update the app's permissions in GitHub.
  </Accordion>
</AccordionGroup>

## Disconnecting GitHub

To remove the GitHub integration:

<Steps>
  <Step title="Go to Workspace Settings">
    Click **Settings** → **Integrations**.
  </Step>

  <Step title="Find GitHub">
    Locate the GitHub integration in the list.
  </Step>

  <Step title="Click Disconnect">
    Select **Disconnect** from the menu.
  </Step>

  <Step title="Confirm">
    Confirm that you want to remove the integration.
  </Step>
</Steps>

<Warning>
  Disconnecting removes access for all projects. AI coworkers will no longer be able to interact with GitHub.
</Warning>

## Security Considerations

* **OAuth-based**: Uses GitHub OAuth, not personal access tokens
* **Granular access**: You choose which repositories to share
* **Revocable**: Can be disconnected anytime from Trilo or GitHub
* **Audit logged**: Actions are tracked in task and workspace activity

## Next Steps

<CardGroup cols={2}>
  <Card title="All Integrations" icon="plug" href="/settings/integrations">
    See all available integrations.
  </Card>

  <Card title="AI Coworkers" icon="robot" href="/ai-coworkers/overview">
    Learn what AI can do with integrations.
  </Card>
</CardGroup>
