Tools catalog

Git operations

Structured git for agents. Status, diff, log, blame, add, commit, branches, stash and worktrees, with push and reset off unless you turn them on.

1 min read

git_ops gives an agent git as named actions with fixed arguments, instead of shell strings. It runs real git in the project, with a timeout, and never takes a free-form command line, so a model can't slip extra flags in.

Push and reset are off by default. Turn each on deliberately.

Actions

ActionArgumentsWhat it does
statusChanged, staged and untracked files
diffpaths, stagedThe working-tree diff, or --staged
logref, limit (default 15)Recent commits
showrefOne commit
blamepathsWho changed each line
branchBranches
addpathsStage files
commitmessageCommit what is staged
checkoutref or pathsSwitch branch, or restore files
stash, stash_list, stash_popmessagePark and restore changes
worktree_add, worktree_list, worktree_removerefWork on another branch in a second folder
push, resetRefused unless enabled

Use it

Agent.with_builtins() includes git_ops for the project root. To set it up yourself:

python
from shipit_agent import Agent, GitOpsTool
from shipit_agent.llms import build_llm_from_env

git = GitOpsTool(root_dir=".", allow_push=False, allow_reset=False, timeout_seconds=60)
agent = Agent(llm=build_llm_from_env(), tools=[git])
agent.run("Summarise what changed since the last commit, then commit it with a clear message.")
ArgumentDefaultWhat it does
root_dir"."The repository it works in
allow_pushFalseLet the agent push
allow_resetFalseLet the agent reset
timeout_seconds60Longest a git command may run

Pair it with permissions to ask before a commit, for example ask=["git_ops"].

See also

  • Bash for everything that isn't git
  • GitHub for pull requests and issues