1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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:
```bash
PYGITTOOLS_REPO=/path/to/repo uv run pygittools-mcp
```
Cursor project config (`.cursor/mcp.json`):
```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}`.