Skip to main content

PyGitTools

Hooks, tooling, and pygit2 workflows used by PyGitWeb. Can be used headless for many purposes.

PGT

pgt is a terminal UI for commits, branches, tasks, and worktrees. The home page has Status, Log, Tasks, and Worktrees tabs. Arrow keys move the selection and switch tabs; Q or Ctrl-C quits. Press / for slash commands (/help, /actions, /commit, /vim, …). On Status, /actions or the Actions row runs project scripts from pyproject.toml / actions.toml, and also lists mise tasks when mise is available (named groups with depends/run orchestration). Full key bindings are in the in-app help (src/pygittools/help.md).

To run from the repo root, use uv run pgt.

Task objects may include points, a Fibonacci story-point value: 0, 1, 2, 3, 5, 8, 13, or 21. Leave it unset when the task is unestimated; invalid values are stored as unestimated (None).

Hook framework

pygittools.events defines a shared RepoEvent plus abcreg subscribers/dispatchers. pygittools.event_triggers loads per-project [tool.pgt.events.<task>] triggers (optional refs / sources filters) so pygitweb can run specific mise tasks on matching ref updates. pygittools.hooks provides a thin Hook base class plus subclasses for the common client- and server-side git hooks (not every hook Git defines). Receive-pack samples parse <old-oid> <new-oid> <ref> lines with parse_ref_updates(stdin) and pass the result into PreReceive / PostReceive (those classes take an already-parsed list[RefUpdate]).

pygittools.hooks_emit POSTs a JSON RepoEvent to pygitweb /_internal/notify (used by the post-receive.pgtemitter sample). Emission failures are reported on stderr only and never fail the hook.

See hook_samples/ for ready-to-use scripts.

MCP task server

Boards, tasks, and comments stored in Git can be exposed to AI tools via the separate pygittools-mcp package (not bundled with pygittools alone). In this uv workspace, uv run pygittools-mcp uses that package.

Configure the repository path with PYGITTOOLS_REPO, or set PYGITWEB_PROJECTROOT and pass a project argument to each tool. When neither is set, the server discovers a repo from the current working directory.

Run locally (from this workspace, or after installing pygittools-mcp):

PYGITTOOLS_REPO=/path/to/repo uv run pygittools-mcp

Cursor project config (.cursor/mcp.json):

{
  "mcpServers": {
    "pygittools-tasks": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/pygitweb", "pygittools-mcp"],
      "env": {
        "PYGITTOOLS_REPO": "/path/to/your/repo"
      }
    }
  }
}

Tools: list_boards_tool, list_tasks_tool, get_task_tool, create_task_tool, list_comments_tool (optional task_ref or mr_ref), get_comment_tool, board_by_status_tool. Resources: board://{board_name}, task://{task_ref}, comment://{comment_oid}.

Metadata

Release files for pygittools 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygittools 0.4.0
File Size Uploaded Provenance Actions
pygittools-0.4.0.tar.gz 127.5 kB Without provenance Details for pygittools-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygittools 0.4.0
File Interpreter ABI Platform Actions
pygittools-0.4.0-py3-none-any.whl Python 3 none any Details for pygittools-0.4.0-py3-none-any.whl

Total release size: 295.9 kB

Release files / pygittools-0.4.0.tar.gz

Download URL pygittools-0.4.0.tar.gz
Size 127.5 kB
Tags Source
SHA-256 checksum
How to use checksums
46ed3879a7ceb31f3c7ee1cccf6e9741c3c0231e758d0a345533f4c4330ac1ab
BLAKE2b-256 checksum
How to use checksums
76b0724e293822245dd4290302c8697dc1a0556d03fe57c032f45a292f5319b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pygittools-0.4.0-py3-none-any.whl

Download URL pygittools-0.4.0-py3-none-any.whl
Size 168.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed58126452c338e2b21f141afaef5600d4e5b9bc5b36cf5489b6627c3ef84e8f
BLAKE2b-256 checksum
How to use checksums
9310d0be1bca4cd72fa70f3f813df80a678b8d55c2d0d7c4be9b90eb6db923a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pygittools 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page