Git issue agent helps you resolve your issues based on your code repository. It works like a Jr developer who can read your code and help you resolve your issues. It works as a product developer who can recommend changes based on your code. It works as a product manager who can help you prioritize your issues. It works as a project manager who can help you manage your issues. It works as a QA who can help you test your code. It works as a designer who can help you design your code. It works as a technical writer who can help you write your code. It works as a technical lead who can help you lead your code. It works as a senior developer who can help you develop your code.
-
Node.js: Version 20 or higher is required to run this application. You can download it from nodejs.org.
-
GitHub App: You need to create a GitHub App with the following configurations:
- Subscribed Events: Ensure the app is subscribed to the following events:
- Pull Request: To handle pull request events.
- Issues: To handle issue events.
- Issue Comment: To handle comments on issues.
- Permissions:
- Pull requests: Read & write
- Metadata: Read-only
- Issues: Read & write
- Subscribed Events: Ensure the app is subscribed to the following events:
-
Environment Variables: Set up a
.envfile in the root of your project with the following variables:APP_ID: Your GitHub App's ID.PRIVATE_KEY_PATH: Path to your GitHub App's private key file.WEBHOOK_SECRET: Your GitHub App's webhook secret.ENTERPRISE_HOSTNAME(optional): If using GitHub Enterprise, set this to your enterprise hostname.PORT(optional): The port your server will listen on (default is 3000).
-
Local Development Tunnel: For local development, use a tunneling service to expose your local server to the internet. Options include:
-
Dependencies: Ensure all necessary npm packages are installed by running
npm installin your project directory.
- Clone this repository.
- Create a
.envfile similar to.env.exampleand set actual values. If you are using GitHub Enterprise Server, also include aENTERPRISE_HOSTNAMEvariable and set the value to the name of your GitHub Enterprise Server instance. - Install dependencies with
npm install. - Start the server with
npm run server. - Ensure your server is reachable from the internet.
- If you're using
smee, runsmee -u <smee_url> -t http://localhost:3000/api/webhook.
- If you're using
- Ensure your GitHub App includes at least one repository on its installations.
With your server running, you can now create a pull request on any repository that
your app can access. GitHub will emit a pull_request.opened event and will deliver
the corresponding Webhook payload to your server.
The server in this example listens for pull_request.opened events and acts on
them by creating a comment on the pull request, with the message in message.md,
using the octokit.js rest methods.
To keep things simple, this example reads the GITHUB_APP_PRIVATE_KEY from the
environment. A more secure and recommended approach is to use a secrets management system
like Vault, or one offered
by major cloud providers:
Azure Key Vault,
AWS Secrets Manager,
Google Secret Manager,
etc.
This is a GitHub App built with TypeScript and Bun.
- Install dependencies:
bun install- Start the development server:
bun devThis project is configured to deploy to Vercel using Bun for building.
Make sure to set the following environment variables in your Vercel project:
APP_ID: Your GitHub App IDWEBHOOK_SECRET: Your GitHub App webhook secretPRIVATE_KEY: Your GitHub App private key (replace newlines with \n)- Any other environment variables your app requires
Push your changes to GitHub and connect your repository to Vercel, or use the Vercel CLI:
vercelMIT