The Revwr is a Chrome extension that provides an interactive chat interface for users to get explanations for code differences (diffs) within a codebase during a pull request review on GitHub. The extension allows users to select specific lines or an entire file to receive explanations, making it easier to understand changes in the code. The extension communicates with a server component, which uses OpenAI's GPT-3.5 Turbo model to generate responses based on the user's queries.
- Interactive chat interface for easy communication
- Support for explaining selected lines, entire files, or all diffs in a pull request
- Seamless integration with GitHub's pull request review interface
- Backend server component that leverages OpenAI's GPT-3.5 Turbo model
- Navigate to the
chrome_extensionfolder in the repository. - In Chrome, go to
chrome://extensions/. - Toggle on the "Developer mode" switch in the top-right corner of the extensions page.
- Click the "Load unpacked" button and select the
chrome_extensionfolder. - The Code Review Assistant extension should now be installed and ready to use on GitHub pull requests.
- Ensure you have Node.js installed on your system.
- Navigate to the
serverfolder in the repository. - Run the following command to install the required dependencies:
npm install- Create a
.envfile in theserverfolder and add the following content:
OPENAI_API_KEY=your_openai_api_key_here
PORT=3000
NODE_ENV=testReplace your_openai_api_key_here with your actual OpenAI API key. The NODE_ENV variable can be set to test for test mode or left unset for normal operation.
- In the
chrome_extensionfolder, locate thesubmitChat()function in thejs/chat.jsfile and update the server URL (currentlyhttp://localhost:3000/review) to match your server's address and port, if necessary. - Start the server by running
node server.jsfrom theserverfolder. The server should now be running and ready to process chat requests from the extension. With both the Chrome extension and server component set up, the Code Review Assistant is ready to use on GitHub pull requests.
- After successfully installing the Revwr Chrome extension and setting up the server component, navigate to a pull request and go to "Files changed" tab.
- Click the Revwr extension button in the Chrome toolbar to open the extension in a sidebar. The sidebar will display a list of all files in the pull request, with an "Explain" button under each file.
- To get an explanation of a specific file, click the "Explain" button under the file's name.
- To get an explanation of selected lines, highlight the desired lines in the pull request by click and dragging the checkboxes. Then, click the "Explain Selected" button in the Revwr sidebar
- To get an explanation of all the files in the pull request, click the "Explain All" button in the Revwr sidebar.
- If you need further clarification or have additional questions, continue the conversation with the AI assistant in the chat interface.
- When you're satisfied with the explanations provided, click the "Close" button or click on the extension button again.
This README was mostly autogenerated by ChatGPT. The future is now!
