Skip to content

GitHub

By enabling this toolset, HolmesGPT will be able to interact with GitHub repositories, read files, create pull requests, and manage branches. This is useful for accessing runbooks, documentation, or configuration files stored in GitHub.

Prerequisites

  1. A GitHub Personal Access Token with appropriate permissions:
  2. repo scope for private repositories
  3. public_repo scope for public repositories
  4. pull_requests:write for creating PRs

You can create a token at GitHub Settings > Developer settings > Personal access tokens.

Configuration

First, set the following environment variable:

export GITHUB_TOKEN="<your GitHub personal access token>"

Then add the following to ~/.holmes/config.yaml, creating the file if it doesn't exist:

toolsets:
  git/github:
    enabled: true

To test, run:

holmes ask "Check the troubleshooting guide in our GitHub repository for common deployment issues"
holmes:
  additionalEnvVars:
    - name: GITHUB_TOKEN
      value: "<your GitHub personal access token>"
  toolsets:
    git/github:
      enabled: true

Advanced Configuration

You can configure additional options:

toolsets:
  git/github:
    enabled: true
    config:
      default_branch: "main"  # Default branch to use
      max_file_size: 1048576  # Maximum file size to read (1MB)
      timeout: 30  # Request timeout in seconds

Capabilities

Tool Name Description
github_read_file Read a file from a GitHub repository
github_list_files List files in a GitHub repository directory
github_search_files Search for files in a repository by name or content
github_create_pr Create a new pull request
github_update_pr Update an existing pull request
github_list_branches List branches in a repository
github_create_branch Create a new branch
github_get_commit Get details about a specific commit