git
Run version control commands with compact, token-cheap output. Read status, logs, diffs; write commits, branches, merges, pushes—ideal for AI-driven repository management.
Instructions
Run git with compact, token-cheap output. Read: status, log, diff, show, blame, branches, tags, remotes, stash_list, file_history, current, root, config_get. Write: add, unstage, commit, checkout, branch_create, branch_delete, merge, rebase, reset, revert, restore, stash, stash_pop, tag_create, fetch, pull, push, apply, clean, init. Anything else: action="raw" with args=["..."]. git runs directly, not through a shell, so commit messages with quotes and newlines need no escaping.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | add: stage everything. commit: stage tracked changes first (-a). branches: include remotes. | |
| cwd | No | Repository directory. Default: server cwd. | |
| key | No | config_get: the config key, e.g. user.email. | |
| ref | No | Branch, tag, commit or range — depends on the action (show, diff, checkout, merge, reset, ...). | |
| args | No | For action="raw": the full git argv, e.g. ["bisect","start"]. For other actions: extra flags appended to the command. | |
| hard | No | reset: --hard (DISCARDS working tree changes) instead of --mixed. | |
| stat | No | diff/show/log: summarise as changed files + line counts instead of full patch. Much cheaper. | |
| amend | No | commit: amend the previous commit. | |
| force | No | push/branch_delete/clean: force the operation. | |
| limit | No | log/file_history: how many commits. Default 20. | |
| patch | No | apply: the unified diff text to apply. | |
| paths | No | Files/paths the action applies to (add, diff, checkout, restore, blame, file_history, ...). | |
| action | Yes | What to do. Use "raw" with args for any git command not listed. | |
| remote | No | fetch/pull/push: remote name. Default origin. | |
| staged | No | diff: show the staged changes (--cached). | |
| message | No | commit/tag_create/stash: the message. | |
| max_bytes | No | Byte cap on returned output. | |
| timeout_ms | No | Kill git after this long. Network actions default to 120000. |