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

# GitHub Bot

> AI-powered issue triage and answers directly in your GitHub repositories

Add Gurubase to your GitHub repositories to automatically answer issues, help with triage, and provide instant documentation lookups — all without leaving GitHub.

<Frame>
  <img src="https://mintcdn.com/gurubase/jeAHiHwl0JAA3N8C/images/bots/github/gurubase-github-bot-demo.png?fit=max&auto=format&n=jeAHiHwl0JAA3N8C&q=85&s=82b71512541444e9a1c71bec2a518c39" alt="GitHub Bot Example" width="1898" height="890" data-path="images/bots/github/gurubase-github-bot-demo.png" />
</Frame>

## Why Use the GitHub Bot?

<CardGroup cols={2}>
  <Card title="Instant Issue Triage" icon="bolt">
    Bot automatically responds to new issues with relevant documentation and answers
  </Card>

  <Card title="Reduce Maintainer Burden" icon="users">
    Common questions get answered automatically, freeing maintainers for complex issues
  </Card>

  <Card title="Context-Aware Answers" icon="brain">
    Bot considers issue title, body, and comments to provide relevant responses
  </Card>

  <Card title="Works with Your Docs" icon="book">
    Answers are grounded in your actual documentation, README, and knowledge base
  </Card>
</CardGroup>

## How It Works

| Mode       | Behavior                                                                                       |
| ---------- | ---------------------------------------------------------------------------------------------- |
| **Auto**   | Bot automatically replies when issues are created. For follow-up comments, mention `@gurubase` |
| **Manual** | Bot only responds when explicitly mentioned with `@gurubase`                                   |

You can set different modes per repository and always mention the bot for on-demand answers.

<Note>
  **Self-hosted users:** You'll need to create your own GitHub App first. See [GitHub App Setup for Self-hosted](#github-app-setup-for-self-hosted-version).
</Note>

***

## Setup (Gurubase Cloud)

<Steps>
  <Step title="Navigate to GitHub Bot">
    Go to **Gurubase Dashboard** → Select your Guru → **Integrations** → **Deployments** → **GitHub**
  </Step>

  <Step title="Connect to GitHub">
    Click **Connect** and authorize Gurubase to access your repositories. You can grant access to all repositories or select specific ones.

    <Frame>
      <img src="https://mintcdn.com/gurubase/jeAHiHwl0JAA3N8C/images/bots/github/gurubase-github-integrations-1.png?fit=max&auto=format&n=jeAHiHwl0JAA3N8C&q=85&s=f164506a8a8c6a3cd21ee4bfc1f83392" alt="Gurubase github integration page" width="1193" height="204" data-path="images/bots/github/gurubase-github-integrations-1.png" />
    </Frame>
  </Step>

  <Step title="Set Repository Mode">
    For each repository, choose **Auto** or **Manual** mode from the dropdown.
  </Step>

  <Step title="Manage Repositories">
    Click **Manage** at the bottom to add or remove repositories via GitHub's app settings. Refresh the Gurubase page to see changes.
  </Step>
</Steps>

<Note>
  You can connect up to 100 repositories per Guru.
</Note>

***

## Using the Bot

Mention `@gurubase` in any issue to ask a question:

```markdown theme={null}
@gurubase How do I configure authentication in this project?
```

The bot considers:

* The comment that mentions it
* Issue title and description
* Previous comments in the thread

<Note>
  **Self-hosted:** Mention `@your-app-slug` instead of `@gurubase`. Find your slug in the GitHub App URL.
</Note>

***

## Permissions

| Permission    | Access       | Purpose                        |
| ------------- | ------------ | ------------------------------ |
| Metadata      | Read         | View repository information    |
| Issues        | Read & Write | Respond to issues              |
| Discussions   | Read & Write | Future: respond to discussions |
| Pull Requests | Read & Write | Future: respond to PR comments |

<Note>
  Currently, the bot only works in **Issues**. Discussions and Pull Request support is coming soon.
</Note>

## GitHub App Setup for Self-hosted version

For self-hosted version, you need to create your own GitHub app to create a bot to integrate with your Gurubase Self-hosted instance. Gurubase needs **Client ID**, **Installation ID**, **Private Key**, and **Webhook Secret (Optional)** from GitHub to integrate with your repositories.

<Frame>
  <img src="https://mintcdn.com/gurubase/O6mo4rszDqTtuRsW/images/bots/github/gurubase-github-empty.png?fit=max&auto=format&n=O6mo4rszDqTtuRsW&q=85&s=def9983c969d8649ddb0a107e3b9b489" alt="Gurubase Github Empty" width="600px" data-path="images/bots/github/gurubase-github-empty.png" />
</Frame>

Below are the steps to create the app and get these values.

1. GitHub will send events to  `/api/github/` endpoint of your Gurubase instance. If the Gurubase instance URL is not public, you need to open it to public. You can use [ngrok](https://ngrok.com/) to do this:
   * If you haven't changed, the default port of Gurubase instance is 8029. You need to use this to make it publicly accessible.
   * Make Gurubase instance URL public with `ngrok http http://localhost:8029`
   * Copy the public URL from the ngrok terminal as shown below:

<Frame>
  <img src="https://mintcdn.com/gurubase/O6mo4rszDqTtuRsW/images/bots/slack/slack-ngrok-url.png?fit=max&auto=format&n=O6mo4rszDqTtuRsW&q=85&s=1769f316a58a3a47d9946790634b3df4" width="1578" height="308" data-path="images/bots/slack/slack-ngrok-url.png" />
</Frame>

2. Go to [https://github.com/settings/apps](https://github.com/settings/apps) and click "New GitHub App".
3. Type in the name, description, and homepage URL. You can specify `https://gurubase.io/` for the Homepage URL.
4. Leave the "Callback URL" empty and untick all of the checkboxes below it.

<Frame>
  <img src="https://mintcdn.com/gurubase/O6mo4rszDqTtuRsW/images/bots/github/github-callback.png?fit=max&auto=format&n=O6mo4rszDqTtuRsW&q=85&s=f7c6b22a9b433d9f05fd296a9a2266d5" alt="GitHub Callback" width="1790" height="884" data-path="images/bots/github/github-callback.png" />
</Frame>

5. Under "Post installation", keep the "Setup URL" empty and untick "Redirect on update".

<Frame>
  <img src="https://mintcdn.com/gurubase/O6mo4rszDqTtuRsW/images/bots/github/github-post-installation.png?fit=max&auto=format&n=O6mo4rszDqTtuRsW&q=85&s=4eba95cb2e31122b47e1c4ae44f04f79" alt="GitHub Post Installation" width="1572" height="484" data-path="images/bots/github/github-post-installation.png" />
</Frame>

6. Under "Webhook", make it active.

7. Set the Webhook URL as `${your_public_gurubase_url}/api/github/`

<Note>
  Make sure you keep the `/` at the end.
</Note>

8. Optionally, you can set a secret for the webhook. If you set a secret, copy it and paste it in the **Webhook Secret** field in the GitHub integration page on Gurubase.

9. Keep SSL verification enabled.

<Frame>
  <img src="https://mintcdn.com/gurubase/O6mo4rszDqTtuRsW/images/bots/github/github-webhook.png?fit=max&auto=format&n=O6mo4rszDqTtuRsW&q=85&s=8e0a93f8297e345fb87aa586885b9b7c" alt="GitHub Webhook" width="1706" height="932" data-path="images/bots/github/github-webhook.png" />
</Frame>

10. Under "Permissions", click "Repository permissions"

11. Select "Read and write" for these:

* Discussions
* Issues
* Pull requests

<Note>
  This will also add Read-only permission to Metadata. Keep it.
</Note>

<Frame>
  <img src="https://mintcdn.com/gurubase/O6mo4rszDqTtuRsW/images/bots/github/github-permissions.png?fit=max&auto=format&n=O6mo4rszDqTtuRsW&q=85&s=047dd82cde949f468f124b00de8dc00d" alt="GitHub Permissions" width="1784" height="1370" data-path="images/bots/github/github-permissions.png" />
</Frame>

12. Under "Subscribe to events", tick these:

* Discussion
* Discussion comment
* Issues
* Issue comment
* Pull request
* Pull request review
* Pull request review comment
* Pull request review thread

<Frame>
  <img src="https://mintcdn.com/gurubase/O6mo4rszDqTtuRsW/images/bots/github/github-events.png?fit=max&auto=format&n=O6mo4rszDqTtuRsW&q=85&s=80c3c40fe7a3ef91d089fde2d9391c82" alt="GitHub Events" width="1768" height="1886" data-path="images/bots/github/github-events.png" />
</Frame>

13. In the final section "Where can this GitHub App be installed?
    ", keep "Only on this account".

14. Then, create the app. This will take you to the app settings page.

15. Get the "Client ID" from this page and paste it in the **Client ID** field in the GitHub integration page on Gurubase.

16. Scroll down to the "Private keys" section on GitHub and click "Generate a private key" button. This will download the generated private key. Open the file in a text editor and copy the private key. Paste it in the **Private Key** field in the GitHub integration page on Gurubase.

17. On the left menu in GitHub, click "Install App" option. On the next page, click "Install" button and follow the instructions and install the app to your GitHub account by configuring the repository permissions and repositories.

<Note>
  You can also add/remove repositories to the app after it is installed as explained in the [Steps to Integrate](#steps-to-integrate) section.
</Note>

18. Once done, it will take you to a page with URL `https://github.com/settings/installations/<installation_id>`. Get the installation ID from the URL and paste it in the **Installation ID** field in the GitHub integration page on Gurubase.

19. Now, open Gurubase and go to the GitHub integration page and click "Connect" button.

<Note>
  If you do not provide a webhook secret, it will not be checked even if it is configured on GitHub.
</Note>

20. If everything is done correctly, you will see the repositories you have connected to Gurubase as shown below.

<Frame>
  <img src="https://mintcdn.com/gurubase/O6mo4rszDqTtuRsW/images/bots/github/gurubase-github-full.png?fit=max&auto=format&n=O6mo4rszDqTtuRsW&q=85&s=d12e66e52cf8202963ccafd447705f4c" alt="Gurubase Github Full" width="2326" height="1520" data-path="images/bots/github/gurubase-github-full.png" />
</Frame>

21. You can follow the [Steps to Integrate](#steps-to-integrate) section to learn more about the usage of the bot.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Data Sources" icon="database" href="/guides/data-sources">
    Add documentation the bot will reference
  </Card>

  <Card title="Slack Bot" icon="slack" href="/integrations/bots/slack">
    Add Gurubase to your Slack workspace
  </Card>

  <Card title="Discord Bot" icon="discord" href="/integrations/bots/discord">
    Add Gurubase to your Discord server
  </Card>

  <Card title="Website Widget" icon="browser" href="/integrations/bots/website-widget">
    Embed Gurubase on your documentation site
  </Card>
</CardGroup>
