An AI-powered CLI tool to help you write better commit messages and PRs.
Project description
G3
All-in-one CLI to commit your work to Github [Docs]
Install
pip install g3
Configuration
You will be asked to enter:
- your Github token
- your open-ai key
- the openai model you want to use
- the temperature which will be used to generate the commit messages and PR descriptions
- the openai api version
- the tone which will be used in the commit messages and PR descriptions
- the commit message max characters
- the PR description max words
Usage
Commit
g3 commit
Options:
- --tone: The tone used
- --jira: The jira ticket(s) referenced
- --include: Include a phrase you want
- --edit: On a commit
PR
g3 pr
Options:
- --tone: The tone used
- --jira: The jira ticket(s) referenced
- --include: Include a phrase you want
- --edit: On a pr
Alias
You can also make an alias g=g3
so that you execute simply g commit
and g pr
.
Development
The project requires Python 3.11
and Poetry for dependency management.
Optionally configure poetry to create the virtual environment within the project as follows:
poetry config virtualenvs.in-project true
Build
Now install the project, along with its development dependencies, in a local virtual environment as follows:
poetry install
You may enable the virtual environment, so that you run modules without the poetry run
prefix, as follows:
source `poetry env info -p`/bin/activate
or simply as follows:
poetry shell
Contribution
You are expected to enable pre-commit hooks so that you get your code auto-sanitized before being committed.
- mypy: Static type checker of variables and functions based on PEP 484
- isort: Optimizes imports
- black: Opinionated code formatter based on PEP 8
- flake8: Improves code style and quality based on PEP 8
Install pre-commit before starting to contribute to the project as follows:
pre-commit install
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.