3.8 KiB
title, description
| title | description |
|---|---|
| Github | Let your agent access Github |
The Github extension allows your agent to interact with Github repositories, issues, pull requests, and more, making it ideal for automating code-related tasks, managing projects, or gathering information from Github.
Setup
To use the Github extension, you need to obtain an API key from Brave Search. You can get one by signing up atTo install the Web Search extension, run the following command in your terminal:
ironclaw registry install github
After installing the extension, you need to configure your Github API key in IronClaw. You can do this by running:
ironclaw tool auth github
Then follow the prompts to enter your API key.
Be sure to create a fine-grained personal access token with only the necessary permissions for your use case. When in doubt, choose the least permissive options, you can always create new tokens with different permissions later onAvailable Actions:
Here are some of the actions your agent can perform with the Github extension:
get_repo: Retrieve repository informationlist_issues: List all issues in a repositorycreate_issue: Create a new issueget_issue: Get details of a specific issuelist_issue_comments: List comments on an issuecreate_issue_comment: Add a comment to an issuelist_pull_requests: List pull requestscreate_pull_request: Create a new pull requestget_pull_request: Get details of a specific pull requestget_pull_request_files: Get the list of files in a pull requestcreate_pr_review: Submit a pull request reviewlist_pull_request_comments: List review comments on a pull requestreply_pull_request_comment: Reply to a pull request review commentget_pull_request_reviews: Get reviews for a pull requestget_combined_status: Get the combined status for a refmerge_pull_request: Merge a pull requestlist_repos: List repositories (user/org)get_file_content: Retrieve the content of a file in the repotrigger_workflow: Manually trigger a GitHub Actions workflowget_workflow_runs: List recent workflow runshandle_webhook: Handle a GitHub webhook payload
Working on Public Repositories
Lets configure our agent to have its own github account, which it can use to create issues and comment on PRs in public repositories.
Go to https://github.com and create a new account for your agent. If you are already logged in with your personal account you will need to briefly log out to create the new account, but you can log back in right after
On the agent's Github account, go to Settings -> Developer settings -> Personal access tokens -> Tokens (classic) and generate a new token (classic) with the following permissions: repo -> public_repo
ironclaw tool auth github
Then follow the prompts to enter the token you just generated.
Ask your agent to create a test issue in one of your public repositories, and check if the issue was created successfully.
Ask your agent to read the [Github Markdown Guidelines](https://github.com/adam-p/markdown-here/wiki/markdown-cheatsheet) and remember then when creating issues and comments, it can make the formatting much nicer!