gait-cli
v0.4.0
Published
A CLI tool to automate Git workflows using AI-generated commit/pr messages.
Readme
gAIt CLI
A CLI tool to automate Git workflows using AI-generated commit/pr messages.
Installation
npm install -g gait-cliPrerequisites
OpenAI API Key: Export your OpenAI API key as an environment variable:
export OPENAI_API_KEY=your-openai-api-keyGitHub CLI: Ensure the
ghCLI is installed and authenticated with your GitHub account. GitHub CLI Installation Guide.
Usage
Command: gait commit
The gait commit command automates the process of generating a commit message and committing staged changes.
Workflow:
- Stage your changes manually using
git add. - The command generates a commit message based on the staged changes.
- Creates a Git commit with the generated message.
Syntax:
gait commitExample
# Stage your changes
git add .
# Run the command
gait commitExpected output:
Changes staged for commit, committing...
Generated Commit Message: Add new feature to improve user experience
[master 123abc4] Add new feature to improve user experience
Changes committed successfully!Command: gait pr (Alias: gait pull-request)
The gait pr command automates the process of pushing a branch and creating a pull request on GitHub.
Workflow:
- Stage your changes manually using
git add. - The command generates a commit message based on the staged changes.
- Creates a Git commit, pushes the branch, and opens a pull request in your browser.
Syntax:
gait pr --branch <branch-name>Options:
-b, --branch <branch>: Specify the branch name. Defaults to the current branch if not provided.
Example
# Stage your changes
git add .
# Run the command
gait pr --branch feature/add-new-featureExpected output:
Changes staged for commit, committing...
Generated Commit Message: Add new feature to improve user experience
[feature/add-new-feature 123abc4] Add new feature to improve user experience
Branch 'feature/add-new-feature' set up to track remote branch 'feature/add-new-feature' from 'origin'.
Pull request created successfully!This will create a pull request on GitHub and open it in your browser.
License
This project is licensed under the MIT License. See the LICENSE file for details.
