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/kto navigate Enterto confirm actions, stage or unstage files or categoriesSpaceto collapse menusctrl-corescto 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}.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygittools-0.2.1.tar.gz.
File metadata
- Download URL: pygittools-0.2.1.tar.gz
- Upload date:
- Size: 67.4 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
497eb0225ad4a17bfc1f20f7dd96ca8dc651a994b0b4e5efa40b9e2f9baf5b8d
|
|
| MD5 |
d1ef07fc20e04cbb47f4c9bbe96f5e19
|
|
| BLAKE2b-256 |
6c94961b9fc0734ddc1a742baacb3d42903d959bfd72aa09926f3c7d3a8d164f
|
File details
Details for the file pygittools-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pygittools-0.2.1-py3-none-any.whl
- Upload date:
- Size: 94.2 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9402450d9f0271508dfdacd0480d7a09f588903156e4f95a68663e687d23109
|
|
| MD5 |
cd1d4f99bf4529c94784b91cdba2ffcd
|
|
| BLAKE2b-256 |
65a3dc03fad63540137c8c747868ef4c53af1e1a527eb88ceceef06c9eccb001
|