Automates PR creation on GitHub using GPT-3 for description generation based on commit messages.
Project description
PRGenius
PRGenius automates the creation of pull requests on GitHub by leveraging OpenAI's GPT-3 to generate meaningful and detailed descriptions from your commit messages. It streamlines the PR process, making it easier and more efficient for developers.
Features
- Automated PR Descriptions: Generate detailed PR descriptions from commit messages using GPT-3.
- Flexible: Works with any GitHub repository, supporting customizable base and head branches.
- Easy Integration: Seamlessly integrates into your development workflow with minimal setup.
Getting Started
Prerequisites
- Python 3.7+
- A GitHub account
- An OpenAI API key
Installation
Install PRGenius using pip:
pip install prgenius
Configuration
Before using PRGenius, configure your environment with the necessary credentials:
-
GitHub Token: Create a GitHub Personal Access Token (PAT) with repository access. Follow the instructions on GitHub to create a token.
-
OpenAI API Key: Obtain an API key by creating an account at OpenAI and accessing your API keys section.
Set the following environment variables:
GITHUB_REPO_OWNER=<your-github-username>
GITHUB_REPO_NAME=<your-repository-name>
GITHUB_TOKEN=<your-github-token>
OPENAI_API_KEY=<your-openai-api-key>
You can optionally specify base branch in here as
GITHUB_REPO_BASE_BRANCH=<your-default-branch-in-github>
By default GITHUB_REPO_BASE_BRANCH will be 'develop'
These can be set in a .env
file in the root of your project or exported in your shell session.
Usage
After setting up your environment, PRGenius can be used to automatically create pull requests with rich, AI-generated descriptions based on your commit messages.
To use PRGenius, navigate to your project directory and run:
prgenius create
This command will create a new pull request on GitHub using the commits that are on your current branch but not on your base branch (default develop
).
Advanced Usage
For workflows requiring an immediate merge after creating the pull request, PRGenius offers an auto-merge feature. To create and attempt to auto-merge a pull request, use:
prgenius createmerge
This command attempts to merge the newly created pull request if the predefined conditions are met (e.g., passing all status checks). Ensure your GitHub token has sufficient permissions to merge pull requests in the repository.
Note: The effectiveness of the auto-merge feature depends on your repository's settings and the permissions associated with your GitHub token. It's recommended to review and configure branch protection rules and merge options accordingly.
Contributing
We welcome contributions to PRGenius! If you have suggestions for improvements or encounter a bug, please feel free to contribute. Here's how:
- Fork the project repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -am 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a pull request for review.
Please read CONTRIBUTING.md for more details on our code of conduct and the process for submitting pull requests to us.
License
This project is licensed under the MIT License - see the LICENSE.md file for details. This means you are free to use, modify, and distribute the project as you see fit, as long as you include the original copyright and permission notice in any copies or substantial portions of the software.
Acknowledgments
- Thanks to OpenAI for providing the GPT-3 API, enabling the automation of rich text generation.
- Appreciation goes to GitHub for their robust platform and APIs that facilitate software development and collaboration.
- A shoutout to all the developers and contributors who invest their time and effort into open source projects, making tools like PRGenius possible.
For more detailed information on advanced configurations, features, and usage examples, please refer to the official documentation.
Remember, PRGenius is designed to make your development workflow more efficient and automated. We hope it helps you streamline your PR process and focus more on development.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file PRGenius-1.0.1.tar.gz
.
File metadata
- Download URL: PRGenius-1.0.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.0rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 371500a9dd0a0618e5805ba235278f34d8b8bffaa8c1063a29724864f945d868 |
|
MD5 | 93a8144d6a7df68d8d6a02e7a34f6041 |
|
BLAKE2b-256 | 9b931a3b2d968fd22e368493cc9a445f2326505a647d4a193c29e5f7c616fbe4 |
File details
Details for the file PRGenius-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: PRGenius-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.0rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4777bda067feecb0c4b2ae8afeff7d58cd79cd7e37aeb5a2762ceceed3b33e79 |
|
MD5 | cb8d47fc181b3bf52658f1bd8a3b13fd |
|
BLAKE2b-256 | 04424472e78f0c69c73905c718507a7bb9ec94bef44905c471ff84921c01a3e0 |