Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oceanlvr/ChatGPT-ProBot

🤖️ A ChatGPT based GitHub robot. dialogue/CR/etc..
https://github.com/oceanlvr/ChatGPT-ProBot

chatgpt github-app github-robot probot robot

Last synced: about 1 month ago
JSON representation

🤖️ A ChatGPT based GitHub robot. dialogue/CR/etc..

Awesome Lists containing this project

README

        

# ChatGPT ProBot

[![Release Version](https://img.shields.io/github/release/oceanlvr/ChatGPTBot.svg)](https://github.com/oceanlvr/ChatGPTBot/releases/latest) [![Twitter](https://img.shields.io/twitter/follow/AdaMeta1?style=social)](https://twitter.com/AdaMeta1)

[![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/apps/chatgptbot) [![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/oceanlvr/ChatGPTBot)

A ChatGPT-based GitHub APP. Type `/chatgpt` to chat with robot 🤖️.

![hello](./assets/Hi.jpg)

Powered by [Probot](https://github.com/probot/probot) & [chatgpt-api](https://github.com/transitive-bullshit/chatgpt-api)

## Usage

**Try on [issue#1](https://github.com/oceanlvr/ChatGPT-ProBot/issues/1)**

**Try Review/Refactor on [PR#7](https://github.com/oceanlvr/ChatGPT-ProBot/pull/7)**

| event | description | example |
| ----------- | --------------------------------- | --------------------------------------- |
| `/ping` | ping robot status | |
| `/chatgpt` | chat with bot on issue/PR comment | /chatgpt who are you? |
| `/review` | auto review code in the PR | /review fix the callback hell problem |
| `/refactor` | refactor the code | /refactor fix the callback hell problem |

## Deploy your own APP

1. [Install & Configure the GitHub App](https://github.com/apps/chatgptbot)
2. Create `.env` file following `example.env`, please check config section in your [GitHub apps page](https://github.com/settings/apps)
1. `APP_ID/PRIVATE_KEY/GITHUB_CLIENT_SECRET/GITHUB_CLIENT_ID` is required, please check [chatgptbot settings](https://github.com/settings/apps/chatgptbot) and fill them.
2. **`PRIVATE_KEY` is required, it should be encoded by `base64`**.(`console.log(Buffer.from().toString('base64'))`).
3. `SESSION_TOKEN` is required, it is generated by `ChatGPT` [website](https://chat.openai.com/chat). You can get it following [this step](https://github.com/transitive-bullshit/chatgpt-api#how-it-works).
3. Vercel Deploy (**recommend**), click [![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/oceanlvr/ChatGPTBot) to clone deploy. Copy `.env` file environment to vercel app [environment-variables](https://vercel.com/docs/concepts/projects/environment-variables) in setting page (for me it's `https://vercel.com/oceanlvr/chatgptbot/settings/environment-variables`)
4. Edit the webhooks URL to `${vercelAPPURL}/api/github/webhooks`. For me it's
5. Type `/chatgpt` in an issue, chat with the bot

*step4: update webhook URL to your vercel app domain.*
![webhooks](./assets/webhooks.jpg)

> **Note**
> This package will switch to using the official API once it's released.

## Dev

```sh
# Install dependencies
npm install

# Run the bot
npm dev
```

## License

[ISC](LICENSE) © 2022 oceanlvr