git
Fast native git operations. Uses pygit2 (libgit2 C bindings) for read operations (~1-5ms per call) and async subprocess for write operations. All reads are cached for 500ms.
| Property | Value |
|---|---|
| Module ID | git |
| Version | 1.0.0 |
| Type | user |
| Dependencies | pygit2 (optional, recommended), git CLI, gh CLI (for PRs) |
Design Philosophy
- Speed first — pygit2 calls libgit2 directly in C. No process spawn for reads.
git statusin 3.5ms instead of 300ms with MCP servers. - Cache repeated reads — status/diff/log are cached for 500ms. Write operations invalidate the cache. Sequential reads are near-instant (0.013ms).
- Structured output — every action returns parsed, structured data. No raw text to parse.
- Security-aware — actions are classified by risk: reads are low, local writes are medium, remote operations (push, reset, merge) are high.
Configuration
modules:
git:
config:
workspace: "{{execution.workspace}}"
default_remote: origin
github_token: "{{env.GITHUB_TOKEN}}"
sign_commits: false
Actions (17)
status
Show repository status: branch, staged, unstaged, untracked files. Risk: low
diff
Show changes between working tree, index, or refs. Parameters: target (staged/unstaged/ref), file. Risk: low
log
Commit history with hash, author, date, message. Parameters: limit, branch, file, oneline. Risk: low
blame
Who last modified each line. Parameters: file, start_line, end_line. Risk: low
show
Commit details. Parameters: ref, stat_only. Risk: low
branch_list
List branches. Parameters: all (include remote). Risk: low
add
Stage files. Parameters: files (list). Risk: medium
commit
Create commit. Parameters: message, amend. Risk: medium
branch_create
Create branch. Parameters: name, start_point, checkout. Risk: medium
checkout
Switch branch/ref. Parameters: target. Risk: medium
stash
Save/restore changes. Parameters: action (push/pop/list/drop), message. Risk: medium
tag
Create/list/delete tags. Parameters: action, name, message, ref. Risk: medium
pull
Pull from remote. Parameters: remote, branch, rebase. Risk: medium
push
Push to remote. Parameters: remote, branch, force, set_upstream. Risk: high
reset
Reset branch state. Parameters: mode (soft/mixed/hard), ref. Risk: high
merge
Merge a branch. Parameters: branch, no_ff. Risk: high
pr_create
Create a GitHub pull request via gh CLI. Parameters: title, body, base, draft. Risk: medium