Skip to main content

gcop is your git AI copilot.

Project description

img.png

Gcop is your git AI copilot. You can use any large language model to help automate the generation of commit messages.

Features

  • Generate commit messages by large language models.
  • Easily config your language model.

TECH

Video Demo

Gcop is your git AI copilot

Quick Start

  • Install gcop
pip install gcop
  • If you are first time to use gcop, you need to run the gcop init command to initialize the configuration. This command will alias gcop command on your git.
gcop init

Basic Usage

Run the git ghelp command to get help information and show all gcop commands.

gcop is your local git command copilot
Version: 1.0.0
GitHub: https://github.com/Undertone0809/gcop


Usage: git [OPTIONS] COMMAND
Commands:
  git ghelp      Add command into git config
  git gconfig    Open the config file in the default editor
  git gcommit    Generate a git commit message based on the staged changes and commit the changes

gcop continues to add git gxxx commands later.

Config your language model

Before you generate a commit message, you need to config your language model. You can use any large language model to generate commit messages. The following example shows how to config the language model.

git gconfig

Then gcop will generate a config.yaml, then you can config your language model.config.yaml store path:

  • Windows: %USERPROFILE%\.gcop\config.yaml
  • Linux: ~/.gcop/config.yaml
  • MacOS: ~/.gcop/config.yaml

Config your model in config.yaml, see how to config your model here:

model:
  model_name: provider/name,eg OpenAI/gpt-4
  api_key: YOUR_API_KEY

Generate commit message

The following example show how to use gcop to generate a commit message.

git add .
git gcommit

Video Demo

This video shows how to use gcop to generate a commit message.

Gcop is your git AI copilot

Development

Conda package manager is recommended. Create a conda environment.

conda create -n gcop python==3.10

Activate conda environment and install poetry

conda activate gcop
pip install poetry

Then you can run the client using the following command:

gcop --help

or with Poetry:

poetry run gcop --help

Makefile usage

Makefile contains a lot of functions for faster development.

Install all dependencies and pre-commit hooks

Install requirements:

make install

Pre-commit hooks coulb be installed after git init via

make pre-commit-install

Codestyle and type checks

Automatic formatting uses ruff.

make polish-codestyle

# or use synonym
make formatting

Codestyle checks only, without rewriting files:

make check-codestyle

Note: check-codestyle uses ruff and darglint library

Code security

If this command is not selected during installation, it cannnot be used.

make check-safety

This command launches Poetry integrity checks as well as identifies security issues with Safety and Bandit.

make check-safety

Tests with coverage badges

Run pytest

make test

All linters

Of course there is a command to run all linters in one:

make lint

the same as:

make check-codestyle && make test && make check-safety

Docker

make docker-build

which is equivalent to:

make docker-build VERSION=latest

Remove docker image with

make docker-remove

More information about docker.

Cleanup

Delete pycache files

make pycache-remove

Remove package build

make build-remove

Delete .DS_STORE files

make dsstore-remove

Remove .mypycache

make mypycache-remove

Or to remove all above run:

make cleanup

🛡 License

License

This project is licensed under the terms of the MIT license. See LICENSE for more details.

Contact

For more information, please contact: zeeland4work@gmail.com

See anything changelog, describe the telegram channel

Credits 🚀 Your next Python package needs a bleeding-edge project structure.

This project was generated with P3G

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

gcop-1.0.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

gcop-1.0.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file gcop-1.0.1.tar.gz.

File metadata

  • Download URL: gcop-1.0.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.19 Linux/6.5.0-1022-azure

File hashes

Hashes for gcop-1.0.1.tar.gz
Algorithm Hash digest
SHA256 79bb6328b0aa9cc50b639184981f892c7634c7c9baa9a7e7cf7913afcd97db40
MD5 5077009a62c755217698279ec7069632
BLAKE2b-256 3b003a4939bed1090af008402e98b3f725824ddc92b8843fa6882a2a6a2548d1

See more details on using hashes here.

File details

Details for the file gcop-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: gcop-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.19 Linux/6.5.0-1022-azure

File hashes

Hashes for gcop-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d4707ce682a7583d789d2e0fd9e5208b5dbbb1c522976c5dcb21bec8b8e2588
MD5 3bc630649a0f65275d0254dbc1ca8c6d
BLAKE2b-256 f547dff4c66204be068a9f1f1e2398703c72d466909af5a96414c3131cd891cf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page