popyson-git-scribe


Namepopyson-git-scribe JSON
Version 0.2.5 PyPI version JSON
download
home_pageNone
SummaryA CLI tool to generate commit messages and pull requests using LLM.
upload_time2025-07-16 21:37:11
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords git ai llm commit developer-tools cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # git-scribe

<p align="center">
  <img src="https://raw.githubusercontent.com/popyson1648/git-scribe/main/logo.png" alt="git-scribe logo" width="200"/>
</p>

<p align="center">
  <a href="https://pypi.org/project/popyson-git-scribe/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/popyson-git-scribe.svg"></a>
  <a href="https://pypi.org/project/popyson-git-scribe/"><img alt="Python Versions" src="https://img.shields.io/pypi/pyversions/popyson-git-scribe.svg"></a>
  <a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
</p>
<p align="center">
  <a href="https://github.com/popyson1648/git-scribe/actions/workflows/ci.yml"><img alt="Build Status" src="https://github.com/popyson1648/git-scribe/actions/workflows/ci.yml/badge.svg"></a>
  <a href="https://codecov.io/gh/popyson1648/git-scribe"><img alt="Code Coverage" src="https://codecov.io/gh/popyson1648/git-scribe/graph/badge.svg"></a>
  <a href="https://ai.google.dev/"><img alt="Powered by Gemini" src="https://img.shields.io/badge/Powered%20by-Gemini-blue?logo=google&logoColor=white"></a>
  <a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>

<p align="center">
  <strong>Your AI-powered git assistant for crafting perfect commits and pull requests.</strong>
</p>

<p align="center">
  <a href="#features">Features</a> •
  <a href="#installation">Installation</a> •
  <a href="#usage">Usage</a> •
  <a href="#customization">Customization</a> •
  <a href="#contributing">Contributing</a>
</p>

---

`git-scribe` is a command-line tool that leverages Large Language Models (LLMs) to automatically generate high-quality, conventional commit messages and pull request descriptions. It acts as a smart wrapper around your daily `git` commands, streamlining your workflow and improving your commit history.

## Demo

![Demo of git-scribe in action](https://raw.githubusercontent.com/popyson1648/git-scribe/docs/fix-readme-gif/assets/demo.gif)

## Features

- **AI-Generated Commit Messages**: Automatically generates well-formatted commit messages from your staged changes.
- **AI-Generated Pull Requests**: Creates detailed pull request titles and bodies from your branch diffs.
- **Full `git commit` Compatibility**: Supports passthrough of common `git commit` options like `--all` and `--amend`.
- **Full `gh pr create` Compatibility**: Supports common `gh pr create` options like `--reviewer`, `--label`, `--milestone`, and `--draft`.
- **Interactive Review & Edit**: Always prompts you to review and edit the AI-generated content before any action is taken.
- **Customizable Prompts**: Easily customize the AI's behavior by editing simple markdown files.

## Installation

### Prerequisites

- [Git](https://git-scm.com/)
- [Python 3.8+](https://www.python.org/)

### 1. Install `git-scribe`

You can install the tool from PyPI:

```bash
pip install popyson-git-scribe
```

Alternatively, you can install it directly from the GitHub repository for the latest development version:

```bash
pip install git+https://github.com/popyson1648/git-scribe.git
```

### 2. Initial Setup

After installation, run the `init` command to create the necessary configuration files:

```bash
git-scribe init
```

This will create a new directory at `~/.config/git-scribe/`.

### 3. Configure API Keys

Open the newly created configuration file at `~/.config/git-scribe/config.toml` and add your API keys:

```toml
[api_keys]
gemini = "YOUR_GEMINI_API_KEY"
github = "YOUR_GITHUB_PERSONAL_ACCESS_TOKEN"
```

- **Gemini API Key**: Get yours from [Google AI Studio](https://aistudio.google.com/app/apikey).
- **GitHub Personal Access Token**: Create one [here](https://github.com/settings/tokens) with `repo` scope.

## Usage

### Creating a Commit

1.  Stage your files as you normally would (`git add .`).
2.  Run the `commit` command. `git-scribe` will generate a message for you to review.

```bash
git-scribe commit
```

You can also pass through `git commit` arguments:

```bash
# Commit all tracked files, not just staged ones
git-scribe commit --all

# Amend the previous commit
git-scribe commit --amend
```

### Creating a Pull Request

1.  Push your feature branch to the remote repository.
2.  Run the `pr` command.

```bash
# Create a PR against the 'main' branch
git-scribe pr --base main
```

Add reviewers, labels, and other attributes just like you would with `gh pr create`:

```bash
git-scribe pr --base main --reviewer <user> --label "bug,enhancement" --draft
```

## Command Reference

### `git-scribe commit [OPTIONS]`

Accepts most standard `git commit` options, including but not limited to:
- `--all`, `-a`
- `--amend`
- `--author=<author>`
- `--date=<date>`
- `--no-verify`

### `git-scribe pr [OPTIONS]`

Accepts the following options, compatible with `gh pr create`:
- `--base <branch>`, `-B <branch>`
- `--head <branch>`, `-H <branch>`
- `--reviewer <handle>`, `-r <handle>` (can be specified multiple times)
- `--assignee <login>`, `-a <login>` (can be specified multiple times)
- `--label <name>`, `-l <name>` (can be specified multiple times)
- `--milestone <name>`, `-m <name>`
- `--draft`, `-d`

## Customization

You can fully customize the AI's tone, language, and output format by editing the prompt files located in `~/.config/git-scribe/`.

- **System Prompts (`system_*.md`)**: These files instruct the AI on its role and the strict output format it must follow.
- **User Prompts (`user_*.md`)**: These files are for you. You can add your own project-specific guidelines, examples, or context to further guide the AI. They are empty by default and can be safely left that way.

## Contributing

Contributions are welcome! Please feel free to open an issue or submit a pull request.

### Development Setup

1.  Clone the repository.
2.  Create a virtual environment and activate it.
3.  Install pre-commit hooks:
    ```bash
    pre-commit install
    ```
4.  Install the package in editable mode with development dependencies:
    ```bash
    pip install -e .[dev]
    ```
5.  Run tests:
    ```bash
    pytest
    ```

## License

This project is licensed under the [MIT License](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "popyson-git-scribe",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "git, ai, llm, commit, developer-tools, cli",
    "author": null,
    "author_email": "popyson <popyson@example.com>",
    "download_url": "https://files.pythonhosted.org/packages/6f/e7/3631fe7ffb02a49950bc63b487dea4a3d2270744fc13226526603cc313fc/popyson_git_scribe-0.2.5.tar.gz",
    "platform": null,
    "description": "# git-scribe\n\n<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/popyson1648/git-scribe/main/logo.png\" alt=\"git-scribe logo\" width=\"200\"/>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://pypi.org/project/popyson-git-scribe/\"><img alt=\"PyPI version\" src=\"https://img.shields.io/pypi/v/popyson-git-scribe.svg\"></a>\n  <a href=\"https://pypi.org/project/popyson-git-scribe/\"><img alt=\"Python Versions\" src=\"https://img.shields.io/pypi/pyversions/popyson-git-scribe.svg\"></a>\n  <a href=\"https://opensource.org/licenses/MIT\"><img alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\"></a>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/popyson1648/git-scribe/actions/workflows/ci.yml\"><img alt=\"Build Status\" src=\"https://github.com/popyson1648/git-scribe/actions/workflows/ci.yml/badge.svg\"></a>\n  <a href=\"https://codecov.io/gh/popyson1648/git-scribe\"><img alt=\"Code Coverage\" src=\"https://codecov.io/gh/popyson1648/git-scribe/graph/badge.svg\"></a>\n  <a href=\"https://ai.google.dev/\"><img alt=\"Powered by Gemini\" src=\"https://img.shields.io/badge/Powered%20by-Gemini-blue?logo=google&logoColor=white\"></a>\n  <a href=\"https://github.com/psf/black\"><img alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"></a>\n</p>\n\n<p align=\"center\">\n  <strong>Your AI-powered git assistant for crafting perfect commits and pull requests.</strong>\n</p>\n\n<p align=\"center\">\n  <a href=\"#features\">Features</a> \u2022\n  <a href=\"#installation\">Installation</a> \u2022\n  <a href=\"#usage\">Usage</a> \u2022\n  <a href=\"#customization\">Customization</a> \u2022\n  <a href=\"#contributing\">Contributing</a>\n</p>\n\n---\n\n`git-scribe` is a command-line tool that leverages Large Language Models (LLMs) to automatically generate high-quality, conventional commit messages and pull request descriptions. It acts as a smart wrapper around your daily `git` commands, streamlining your workflow and improving your commit history.\n\n## Demo\n\n![Demo of git-scribe in action](https://raw.githubusercontent.com/popyson1648/git-scribe/docs/fix-readme-gif/assets/demo.gif)\n\n## Features\n\n- **AI-Generated Commit Messages**: Automatically generates well-formatted commit messages from your staged changes.\n- **AI-Generated Pull Requests**: Creates detailed pull request titles and bodies from your branch diffs.\n- **Full `git commit` Compatibility**: Supports passthrough of common `git commit` options like `--all` and `--amend`.\n- **Full `gh pr create` Compatibility**: Supports common `gh pr create` options like `--reviewer`, `--label`, `--milestone`, and `--draft`.\n- **Interactive Review & Edit**: Always prompts you to review and edit the AI-generated content before any action is taken.\n- **Customizable Prompts**: Easily customize the AI's behavior by editing simple markdown files.\n\n## Installation\n\n### Prerequisites\n\n- [Git](https://git-scm.com/)\n- [Python 3.8+](https://www.python.org/)\n\n### 1. Install `git-scribe`\n\nYou can install the tool from PyPI:\n\n```bash\npip install popyson-git-scribe\n```\n\nAlternatively, you can install it directly from the GitHub repository for the latest development version:\n\n```bash\npip install git+https://github.com/popyson1648/git-scribe.git\n```\n\n### 2. Initial Setup\n\nAfter installation, run the `init` command to create the necessary configuration files:\n\n```bash\ngit-scribe init\n```\n\nThis will create a new directory at `~/.config/git-scribe/`.\n\n### 3. Configure API Keys\n\nOpen the newly created configuration file at `~/.config/git-scribe/config.toml` and add your API keys:\n\n```toml\n[api_keys]\ngemini = \"YOUR_GEMINI_API_KEY\"\ngithub = \"YOUR_GITHUB_PERSONAL_ACCESS_TOKEN\"\n```\n\n- **Gemini API Key**: Get yours from [Google AI Studio](https://aistudio.google.com/app/apikey).\n- **GitHub Personal Access Token**: Create one [here](https://github.com/settings/tokens) with `repo` scope.\n\n## Usage\n\n### Creating a Commit\n\n1.  Stage your files as you normally would (`git add .`).\n2.  Run the `commit` command. `git-scribe` will generate a message for you to review.\n\n```bash\ngit-scribe commit\n```\n\nYou can also pass through `git commit` arguments:\n\n```bash\n# Commit all tracked files, not just staged ones\ngit-scribe commit --all\n\n# Amend the previous commit\ngit-scribe commit --amend\n```\n\n### Creating a Pull Request\n\n1.  Push your feature branch to the remote repository.\n2.  Run the `pr` command.\n\n```bash\n# Create a PR against the 'main' branch\ngit-scribe pr --base main\n```\n\nAdd reviewers, labels, and other attributes just like you would with `gh pr create`:\n\n```bash\ngit-scribe pr --base main --reviewer <user> --label \"bug,enhancement\" --draft\n```\n\n## Command Reference\n\n### `git-scribe commit [OPTIONS]`\n\nAccepts most standard `git commit` options, including but not limited to:\n- `--all`, `-a`\n- `--amend`\n- `--author=<author>`\n- `--date=<date>`\n- `--no-verify`\n\n### `git-scribe pr [OPTIONS]`\n\nAccepts the following options, compatible with `gh pr create`:\n- `--base <branch>`, `-B <branch>`\n- `--head <branch>`, `-H <branch>`\n- `--reviewer <handle>`, `-r <handle>` (can be specified multiple times)\n- `--assignee <login>`, `-a <login>` (can be specified multiple times)\n- `--label <name>`, `-l <name>` (can be specified multiple times)\n- `--milestone <name>`, `-m <name>`\n- `--draft`, `-d`\n\n## Customization\n\nYou can fully customize the AI's tone, language, and output format by editing the prompt files located in `~/.config/git-scribe/`.\n\n- **System Prompts (`system_*.md`)**: These files instruct the AI on its role and the strict output format it must follow.\n- **User Prompts (`user_*.md`)**: These files are for you. You can add your own project-specific guidelines, examples, or context to further guide the AI. They are empty by default and can be safely left that way.\n\n## Contributing\n\nContributions are welcome! Please feel free to open an issue or submit a pull request.\n\n### Development Setup\n\n1.  Clone the repository.\n2.  Create a virtual environment and activate it.\n3.  Install pre-commit hooks:\n    ```bash\n    pre-commit install\n    ```\n4.  Install the package in editable mode with development dependencies:\n    ```bash\n    pip install -e .[dev]\n    ```\n5.  Run tests:\n    ```bash\n    pytest\n    ```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A CLI tool to generate commit messages and pull requests using LLM.",
    "version": "0.2.5",
    "project_urls": {
        "Bug Tracker": "https://github.com/popyson1648/git-scribe/issues",
        "Homepage": "https://github.com/popyson1648/git-scribe"
    },
    "split_keywords": [
        "git",
        " ai",
        " llm",
        " commit",
        " developer-tools",
        " cli"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7768c2b1b36865278f64bce635befc04b28de5b93581e5cf61012cf07b7c95c8",
                "md5": "b53b68c47239803f9c324118c1a94273",
                "sha256": "8acb287ea882110732d434dfd233e3251879bb9117fc9f590208a93cec71ead6"
            },
            "downloads": -1,
            "filename": "popyson_git_scribe-0.2.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b53b68c47239803f9c324118c1a94273",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 15614,
            "upload_time": "2025-07-16T21:37:09",
            "upload_time_iso_8601": "2025-07-16T21:37:09.644182Z",
            "url": "https://files.pythonhosted.org/packages/77/68/c2b1b36865278f64bce635befc04b28de5b93581e5cf61012cf07b7c95c8/popyson_git_scribe-0.2.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6fe73631fe7ffb02a49950bc63b487dea4a3d2270744fc13226526603cc313fc",
                "md5": "001e81230745024d9a09109bd0fac3b2",
                "sha256": "408e24e9347ce5d32af7a3b9540b13150b0f959993e2442d679eaa5b05995671"
            },
            "downloads": -1,
            "filename": "popyson_git_scribe-0.2.5.tar.gz",
            "has_sig": false,
            "md5_digest": "001e81230745024d9a09109bd0fac3b2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 14390,
            "upload_time": "2025-07-16T21:37:11",
            "upload_time_iso_8601": "2025-07-16T21:37:11.153133Z",
            "url": "https://files.pythonhosted.org/packages/6f/e7/3631fe7ffb02a49950bc63b487dea4a3d2270744fc13226526603cc313fc/popyson_git_scribe-0.2.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-16 21:37:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "popyson1648",
    "github_project": "git-scribe",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "popyson-git-scribe"
}
        
Elapsed time: 1.51788s