createPr is a command-line tool designed to streamline the process of creating pull requests by leveraging AI to generate descriptions based on Git diffs. It integrates with Azure DevOps and OpenAI to automate and enhance the pull request workflow, ensuring efficient and thorough documentation.
- Automatically fetches Git diffs and summarizes changes.
- Integrates with Azure DevOps to create pull requests.
- Utilizes OpenAI to generate meaningful PR titles and descriptions.
- Supports dry-run mode for testing without actual PR creation.
- Includes customizable PR templates.
- Node.js and npm or yarn should be installed on your system.
- Ensure you have a valid Azure DevOps Personal Access Token and OpenAI API key.
-
Clone the Repository:
git clone https://github.com/yourusername/createPr.git cd createPr -
Install Dependencies:
npm install # or yarn install -
Link the CLI Tool Globally (optional):
npm link
-
Append Repo to Environment Variables: Add the following to your environment variables:
ORGANIZATION=your_organization PROJECT=your_project REPOSITORY_ID=your_repo_id PERSONAL_ACCESS_TOKEN=your_token OPENAI_API_KEY=your_openai_key
create-pr --title "Your PR Title" --description "Your PR Description"Run the tool and let AI generate the title and description for you:
create-pr --dryRun--mock: Runs in mock mode, generating placeholder data.--dryRun: Executes without actually creating the pull request.--debug: Enables debug mode for detailed logging.
Configurations can be set via CLI arguments or environment variables. For complete configuration, refer to src/config.ts.
- Fork the repository and clone it to your local machine.
- Create a new branch for your feature or bugfix.
- Follow our CONVENTIONS.md for coding guidelines.
- Write unit tests for your changes.
- Submit a pull request with a detailed description of your changes.
Run the test suite using:
npm testEnsure all tests pass before submitting contributions.
This project is licensed under the Apache License 2.0.