The agt
command-line tool leverages the power of AI to streamline your Git workflow. By analyzing your code changes, it automates the creation of intelligent commit messages, branch names, and pull requests, saving you time and ensuring consistency.
- Branch Naming: Automatically generate branch names based on conventional commit guidelines.
- Commit Messages: Create consistent and meaningful commit messages powered by AI.
- Pull Request Creation: Generate and open GitHub pull requests directly from your terminal.
- Multi-Service Support: Currently supporting GitHub and Bitbucket, other service providers will come soon.
-
Identify Changes:
- It analyzes the differences between the branch you are currently working on and the base branch.
- It collects staged, unstaged, and untracked changes to generate a context for the operation.
- * The tool must be executed in the root folder of a valid Git repository.
-
Generate AI-Powered Suggestions:
- Using the collected differences as context, the tool generates suggestions for:
- Commit messages
- Pull request titles
- Pull request descriptions
- Branch names
- You can choose one of two methods:
- Call OpenAI Directly: The tool uses OpenAI's latest model to generate suggestions.
- Copy Prompt to Clipboard: The tool copies the generated prompt to your clipboard so you can use your own AI model of choice.
- Using the collected differences as context, the tool generates suggestions for:
-
Handle Uncommitted Changes:
- If there are no committed changes, the tool will stage and commit them into a new branch with the suggested name.
-
Create Pull Request:
- The tool creates a pull request on the appropriate platform (e.g., GitHub) with the suggested title and description.
-
User Interaction:
- You have the opportunity to review and edit all suggestions before the operations are executed, ensuring flexibility and accuracy.
Download the latest release for your platform from the GitHub Releases page.
On Linux/MacOS, make the binary executable:
chmod +x agt
Run the tool directly from the command line:
agt
To display help documentation:
agt --help
- Git installed and configured
- GitHub personal access token (if using with GitHub)
Set up your environment variables:
OPENAI_API_KEY
: Your OpenAI API key.- For GitHub Repos
GITHUB_TOKEN
: Your GitHub personal access token.
- For Bitbucket Repos
BITBUCKET_USERNAME
: Your Bitbucket username.BITBUCKET_APP_PASSWORD
: An app password with permissions to create commits and pull requests.
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License.
- OpenAI for their powerful APIs.