Skip to main content

PyGitTools

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

PGT

PGT is a command line curses application you can use to make commits, switch branches and repos, and do other basic git tasks. Keybinds:

  • Arrow keys or j/k to navigate
  • Enter to confirm actions, stage or unstage files or categories
  • Space to collapse menus
  • ctrl-c or esc to exit.

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

Hook framework

pygittools.hooks provides a thin Hook base class plus one subclass per git hook type (client- and server-side). Receive-pack hooks (PreReceive, PostReceive) parse their ref-update lines via parse_ref_updates(stdin).

pygittools.hooks_notify adds PreReceiveNotify / PostReceiveNotify: minimal hook variants that POST ?project=<name> to a pygitweb /_internal/notify endpoint so its long-poll updates=true subscribers wake up immediately on each push. Notification failures never reject the push.

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

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:

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, board_by_status_tool. Resources: board://{board_name}, task://{task_ref}.

Release files for pygittools 0.2.2

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.2.2
File Size Uploaded
pygittools-0.2.2.tar.gz 68.2 kB Details

Built distribution (wheel)

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

Total release size: 163.0 kB

Release files / pygittools-0.2.2.tar.gz

Download URL pygittools-0.2.2.tar.gz
Size 68.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dcbd8af3d49f105518e85b95be1a8f54034e75c62b906f4620109f02ee9704a0
BLAKE2b-256 checksum
How to use checksums
7c255926346ed64615a8299feda6f1899f0750dbc0c2d1c50b9abd648fd6384b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL pygittools-0.2.2-py3-none-any.whl
Size 94.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
075e5ccf6cbb3ff4700680f2ea0860e4e8180a617d2bad8c64067558d83a7d3b
BLAKE2b-256 checksum
How to use checksums
e9f39b2c7b539e9460b2074a3acfda8f4c8aca68dea2dd44e44279fe1319dd66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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