gcop


Namegcop JSON
Version 1.3.0 PyPI version JSON
download
home_pagehttps://github.com/Undertone0809/gcop
Summarygcop is your git AI copilot.
upload_time2024-07-23 13:47:06
maintainerNone
docs_urlNone
authorgcop
requires_python<4.0,>=3.8.1
licenseMIT
keywords git git copilot promptulate pne llm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="assets/images/banner.png" alt="img.png" style="border-radius: 15px;">

<div align="center">

[![Python Version](https://img.shields.io/pypi/pyversions/gcop.svg)](https://pypi.org/project/gcop/)
[![Dependencies Status](https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg)](https://github.com/Undertone0809/gcop/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot)
[![Semantic Versions](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--versions-e10079.svg)](https://github.com/Undertone0809/gcop/releases)
[![License](https://img.shields.io/github/license/Undertone0809/gcop)](https://github.com/Undertone0809/gcop/blob/main/LICENSE)

<a href="https://t.me/zeeland0809" target="_blank">
    <img src="https://img.shields.io/badge/Telegram-join%20chat-2CA5E0?logo=telegram&logoColor=white" alt="chat on Telegram">
</a>

</div>

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.
- Powerful and simple alias commands to use.

## TECH

- [Promptulate: Large language model automation and Autonomous Language Agents development framework](https://github.com/Undertone0809/promptulate)
- [P3G: Python Packages Project Generator](https://github.com/Undertone0809/P3G)
- [Gamma: Generate gcop Banner here](https://gamma.app/)
- [gpt-4o: Generate project code](https://openai.com/)

## Video Demo

[![Gcop is your git AI copilot](https://zeeland-bucket.oss-cn-beijing.aliyuncs.com/images/20240624003422.png)](https://www.youtube.com/watch?v=j7qKI_TdhXs "Gcop is your git AI copilot")

## Quick Start

- Install gcop

```shell
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.

```shell
gcop init
```

## Basic Usage

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

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


Usage: git [OPTIONS] COMMAND

Commands:
  git p          Push the changes to the remote repository
  git pf         Push the changes to the remote repository with force
  git undo       Undo the last commit but keep the file changes
  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
  git ac         The same as `git add . && git gcommit` command
  git c          The same as `git gcommit` command
```

### 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.

```shell
git gconfig
```

Then gcop will generate a `config.yaml`, then gcop will open the `config.yaml` file in the default editor, and you can config your language model. See how to config your model [here](./docs/how-to-config-model.md):

> `config.yaml` store path:
> - Windows: `%USERPROFILE%\.gcop\config.yaml`
> - Linux: `~/.gcop/config.yaml`
> - MacOS: `~/.gcop/config.yaml`

### Generate commit message

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

```shell
git add .
git gcommit
```

## Video Demo

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

[![Gcop is your git AI copilot](https://zeeland-bucket.oss-cn-beijing.aliyuncs.com/images/20240624003422.png)](https://www.youtube.com/watch?v=j7qKI_TdhXs "Gcop is your git AI copilot")

## All commands

### git gcommit / git c

Generate a git commit message based on the staged changes and commit the changes.

```shell
> git c # You can also use `git gcommit` command
? Select a commit message to commit (Use arrow keys)
 ยป docs: Add 'All commands' section to README.md
   feat: Add 'git gcommit' and 'git gconfig' commands to README.md
   feat: Add 'git config --global alias.pf' command in __main__.py
   retry
```

### git gconfig

Open the config file in the default editor.

### git undo

Undo the last commit.

### git pf

Push force to the current branch, equivalent to `git push --force`.

### git p

Push to the current branch, equivalent to `git push`.

### git ac

The same as `git add . && git gcommit` command.

## Development setup

Conda package manager is recommended. Create a conda environment.

```bash
conda create -n gcop python==3.10
```

Activate conda environment and install poetry

```bash
conda activate gcop
pip install poetry
```

Then you can run the client using the following command:

```bash
gcop --help
```

or with `Poetry`:

```bash
poetry run gcop --help
```

### Makefile usage

[`Makefile`](https://github.com/Undertone0809/gcop/blob/main/Makefile) contains a lot of
functions for faster development.


<details>
<summary>Install all dependencies and pre-commit hooks</summary>
<p>

Install requirements:

```bash
make install
```

Pre-commit hooks coulb be installed after `git init` via

```bash
make pre-commit-install
```

</p>
</details>

<details>
<summary>Codestyle and type checks</summary>
<p>

Automatic formatting uses `ruff`.

```bash
make polish-codestyle

# or use synonym
make formatting
```

Codestyle checks only, without rewriting files:

```bash
make check-codestyle
```

> Note: `check-codestyle` uses `ruff` and `darglint` library

</p>
</details>

<details>
<summary>Code security</summary>
<p>

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

```bash
make check-safety
```

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

```bash
make check-safety
```

</p>
</details>

<details>
<summary>Tests with coverage badges</summary>
<p>

Run `pytest`

```bash
make test
```

</p>
</details>

<details>
<summary>All linters</summary>
<p>

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

```bash
make lint
```

the same as:

```bash
make check-codestyle && make test && make check-safety
```

</p>
</details>

<details>
<summary>Docker</summary>
<p>

```bash
make docker-build
```

which is equivalent to:

```bash
make docker-build VERSION=latest
```

Remove docker image with

```bash
make docker-remove
```

More
information [about docker](https://github.com/Undertone0809/python-package-template/tree/main/%7B%7B%20cookiecutter.project_name%20%7D%7D/docker).

</p>
</details>

<details>
<summary>Cleanup</summary>
<p>
Delete pycache files

```bash
make pycache-remove
```

Remove package build

```bash
make build-remove
```

Delete .DS_STORE files

```bash
make dsstore-remove
```

Remove .mypycache

```bash
make mypycache-remove
```

Or to remove all above run:

```bash
make cleanup
```

</p>
</details>

## ๐Ÿ›ก License

[![License](https://img.shields.io/github/license/Undertone0809/gcop)](https://github.com/Undertone0809/gcop/blob/main/LICENSE)

This project is licensed under the terms of the `MIT` license.
See [LICENSE](https://github.com/Undertone0809/gcop/blob/main/LICENSE) for more details.

## Contact

For more information, please
contact: [zeeland4work@gmail.com](mailto:zeeland4work@gmail.com)

See anything changelog, describe the [telegram channel](https://t.me/zeeland0809)


## Credits [![๐Ÿš€ Your next Python package needs a bleeding-edge project structure.](https://img.shields.io/badge/P3G-%F0%9F%9A%80-brightgreen)](https://github.com/Undertone0809/python-package-template)

This project was generated with [P3G](https://github.com/Undertone0809/P3G)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Undertone0809/gcop",
    "name": "gcop",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": "git, git copilot, promptulate, pne, LLM",
    "author": "gcop",
    "author_email": "zeeland4work@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/45/d7/ed869f8dd4fd1bf530e1a6c70e6ece9fdf3a7aba5d3fdd465e98463cccaf/gcop-1.3.0.tar.gz",
    "platform": null,
    "description": "<img src=\"assets/images/banner.png\" alt=\"img.png\" style=\"border-radius: 15px;\">\n\n<div align=\"center\">\n\n[![Python Version](https://img.shields.io/pypi/pyversions/gcop.svg)](https://pypi.org/project/gcop/)\n[![Dependencies Status](https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg)](https://github.com/Undertone0809/gcop/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot)\n[![Semantic Versions](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--versions-e10079.svg)](https://github.com/Undertone0809/gcop/releases)\n[![License](https://img.shields.io/github/license/Undertone0809/gcop)](https://github.com/Undertone0809/gcop/blob/main/LICENSE)\n\n<a href=\"https://t.me/zeeland0809\" target=\"_blank\">\n    <img src=\"https://img.shields.io/badge/Telegram-join%20chat-2CA5E0?logo=telegram&logoColor=white\" alt=\"chat on Telegram\">\n</a>\n\n</div>\n\nGcop is your git AI copilot. You can use any large language model to help automate the generation of commit messages.\n\n## Features\n\n- Generate commit messages by large language models.\n- Easily config your language model.\n- Powerful and simple alias commands to use.\n\n## TECH\n\n- [Promptulate: Large language model automation and Autonomous Language Agents development framework](https://github.com/Undertone0809/promptulate)\n- [P3G: Python Packages Project Generator](https://github.com/Undertone0809/P3G)\n- [Gamma: Generate gcop Banner here](https://gamma.app/)\n- [gpt-4o: Generate project code](https://openai.com/)\n\n## Video Demo\n\n[![Gcop is your git AI copilot](https://zeeland-bucket.oss-cn-beijing.aliyuncs.com/images/20240624003422.png)](https://www.youtube.com/watch?v=j7qKI_TdhXs \"Gcop is your git AI copilot\")\n\n## Quick Start\n\n- Install gcop\n\n```shell\npip install gcop\n```\n\n- 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.\n\n```shell\ngcop init\n```\n\n## Basic Usage\n\nRun the `git ghelp` command to get help information and show all gcop commands.\n\n```shell\ngcop is your local git command copilot\nVersion: 1.0.0\nGitHub: https://github.com/Undertone0809/gcop\n\n\nUsage: git [OPTIONS] COMMAND\n\nCommands:\n  git p          Push the changes to the remote repository\n  git pf         Push the changes to the remote repository with force\n  git undo       Undo the last commit but keep the file changes\n  git ghelp      Add command into git config\n  git gconfig    Open the config file in the default editor\n  git gcommit    Generate a git commit message based on the staged changes and commit the changes\n  git ac         The same as `git add . && git gcommit` command\n  git c          The same as `git gcommit` command\n```\n\n### Config your language model\n\nBefore 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.\n\n```shell\ngit gconfig\n```\n\nThen gcop will generate a `config.yaml`, then gcop will open the `config.yaml` file in the default editor, and you can config your language model. See how to config your model [here](./docs/how-to-config-model.md):\n\n> `config.yaml` store path:\n> - Windows: `%USERPROFILE%\\.gcop\\config.yaml`\n> - Linux: `~/.gcop/config.yaml`\n> - MacOS: `~/.gcop/config.yaml`\n\n### Generate commit message\n\nThe following example show how to use gcop to generate a commit message. \n\n```shell\ngit add .\ngit gcommit\n```\n\n## Video Demo\n\nThis video shows how to use gcop to generate a commit message.\n\n[![Gcop is your git AI copilot](https://zeeland-bucket.oss-cn-beijing.aliyuncs.com/images/20240624003422.png)](https://www.youtube.com/watch?v=j7qKI_TdhXs \"Gcop is your git AI copilot\")\n\n## All commands\n\n### git gcommit / git c\n\nGenerate a git commit message based on the staged changes and commit the changes.\n\n```shell\n> git c # You can also use `git gcommit` command\n? Select a commit message to commit (Use arrow keys)\n \u00bb docs: Add 'All commands' section to README.md\n   feat: Add 'git gcommit' and 'git gconfig' commands to README.md\n   feat: Add 'git config --global alias.pf' command in __main__.py\n   retry\n```\n\n### git gconfig\n\nOpen the config file in the default editor.\n\n### git undo\n\nUndo the last commit.\n\n### git pf\n\nPush force to the current branch, equivalent to `git push --force`.\n\n### git p\n\nPush to the current branch, equivalent to `git push`.\n\n### git ac\n\nThe same as `git add . && git gcommit` command.\n\n## Development setup\n\nConda package manager is recommended. Create a conda environment.\n\n```bash\nconda create -n gcop python==3.10\n```\n\nActivate conda environment and install poetry\n\n```bash\nconda activate gcop\npip install poetry\n```\n\nThen you can run the client using the following command:\n\n```bash\ngcop --help\n```\n\nor with `Poetry`:\n\n```bash\npoetry run gcop --help\n```\n\n### Makefile usage\n\n[`Makefile`](https://github.com/Undertone0809/gcop/blob/main/Makefile) contains a lot of\nfunctions for faster development.\n\n\n<details>\n<summary>Install all dependencies and pre-commit hooks</summary>\n<p>\n\nInstall requirements:\n\n```bash\nmake install\n```\n\nPre-commit hooks coulb be installed after `git init` via\n\n```bash\nmake pre-commit-install\n```\n\n</p>\n</details>\n\n<details>\n<summary>Codestyle and type checks</summary>\n<p>\n\nAutomatic formatting uses `ruff`.\n\n```bash\nmake polish-codestyle\n\n# or use synonym\nmake formatting\n```\n\nCodestyle checks only, without rewriting files:\n\n```bash\nmake check-codestyle\n```\n\n> Note: `check-codestyle` uses `ruff` and `darglint` library\n\n</p>\n</details>\n\n<details>\n<summary>Code security</summary>\n<p>\n\n> If this command is not selected during installation, it cannnot be used.\n\n```bash\nmake check-safety\n```\n\nThis command launches `Poetry` integrity checks as well as identifies security issues\nwith `Safety` and `Bandit`.\n\n```bash\nmake check-safety\n```\n\n</p>\n</details>\n\n<details>\n<summary>Tests with coverage badges</summary>\n<p>\n\nRun `pytest`\n\n```bash\nmake test\n```\n\n</p>\n</details>\n\n<details>\n<summary>All linters</summary>\n<p>\n\nOf course there is a command to run all linters in one:\n\n```bash\nmake lint\n```\n\nthe same as:\n\n```bash\nmake check-codestyle && make test && make check-safety\n```\n\n</p>\n</details>\n\n<details>\n<summary>Docker</summary>\n<p>\n\n```bash\nmake docker-build\n```\n\nwhich is equivalent to:\n\n```bash\nmake docker-build VERSION=latest\n```\n\nRemove docker image with\n\n```bash\nmake docker-remove\n```\n\nMore\ninformation [about docker](https://github.com/Undertone0809/python-package-template/tree/main/%7B%7B%20cookiecutter.project_name%20%7D%7D/docker).\n\n</p>\n</details>\n\n<details>\n<summary>Cleanup</summary>\n<p>\nDelete pycache files\n\n```bash\nmake pycache-remove\n```\n\nRemove package build\n\n```bash\nmake build-remove\n```\n\nDelete .DS_STORE files\n\n```bash\nmake dsstore-remove\n```\n\nRemove .mypycache\n\n```bash\nmake mypycache-remove\n```\n\nOr to remove all above run:\n\n```bash\nmake cleanup\n```\n\n</p>\n</details>\n\n## \ud83d\udee1 License\n\n[![License](https://img.shields.io/github/license/Undertone0809/gcop)](https://github.com/Undertone0809/gcop/blob/main/LICENSE)\n\nThis project is licensed under the terms of the `MIT` license.\nSee [LICENSE](https://github.com/Undertone0809/gcop/blob/main/LICENSE) for more details.\n\n## Contact\n\nFor more information, please\ncontact: [zeeland4work@gmail.com](mailto:zeeland4work@gmail.com)\n\nSee anything changelog, describe the [telegram channel](https://t.me/zeeland0809)\n\n\n## Credits [![\ud83d\ude80 Your next Python package needs a bleeding-edge project structure.](https://img.shields.io/badge/P3G-%F0%9F%9A%80-brightgreen)](https://github.com/Undertone0809/python-package-template)\n\nThis project was generated with [P3G](https://github.com/Undertone0809/P3G)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "gcop is your git AI copilot.",
    "version": "1.3.0",
    "project_urls": {
        "Homepage": "https://github.com/Undertone0809/gcop",
        "Repository": "https://github.com/Undertone0809/gcop"
    },
    "split_keywords": [
        "git",
        " git copilot",
        " promptulate",
        " pne",
        " llm"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "492d926556d24c6d28a835fd19e0e7eaabb269edfc490a9b4959527db68330c0",
                "md5": "3d3b3d75ddae62c8c7a692aa4f9fa200",
                "sha256": "e27ab1895dae38fae8c82db6af670e9e7cf606701616cad43b846468a188cacc"
            },
            "downloads": -1,
            "filename": "gcop-1.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3d3b3d75ddae62c8c7a692aa4f9fa200",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 9796,
            "upload_time": "2024-07-23T13:47:04",
            "upload_time_iso_8601": "2024-07-23T13:47:04.965744Z",
            "url": "https://files.pythonhosted.org/packages/49/2d/926556d24c6d28a835fd19e0e7eaabb269edfc490a9b4959527db68330c0/gcop-1.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "45d7ed869f8dd4fd1bf530e1a6c70e6ece9fdf3a7aba5d3fdd465e98463cccaf",
                "md5": "5916b824527bcd792233fe58199e62de",
                "sha256": "3901e860574617359c453709334d2c6c114d74df56624bce8b5c99e245e1f90f"
            },
            "downloads": -1,
            "filename": "gcop-1.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5916b824527bcd792233fe58199e62de",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 10761,
            "upload_time": "2024-07-23T13:47:06",
            "upload_time_iso_8601": "2024-07-23T13:47:06.505220Z",
            "url": "https://files.pythonhosted.org/packages/45/d7/ed869f8dd4fd1bf530e1a6c70e6ece9fdf3a7aba5d3fdd465e98463cccaf/gcop-1.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-23 13:47:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Undertone0809",
    "github_project": "gcop",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "gcop"
}
        
Elapsed time: 0.42203s