cmd_git
Run typed Git commands in a Waymark workspace for status, diffs, commits, branches, and pushes; read-only actions run automatically while changes require owner approval.
Instructions
Run a git command in a workspace as a typed action (no shell, no pager, no external diff or filter programs). Nothing can force-push. Reading (status, diff, log, show, branches, stashes, remotes) is automatic; changes wait for the owner unless the owner set them to Auto. reset_hard, clean and branch_delete are switched off unless the owner enables them. For a git operation not listed here use cmd_shell; for what changed on disk without git use code_changes_since. ACTIONS and optionsJson keys (* = required, paths relative to the workspace): status: - diff: staged, stat, revision, paths (array) log: count (1-200, default 20), oneline (default true), stat, revision, paths (array) show: revision*, stat branches, stashes, remotes: - add: paths (array) or all commit: message*, all branch_create: name*, from, switchTo branch_switch: name* stash_push: message, includeUntracked stash_pop: - restore: paths* (array), staged pull: remote, branch (fast-forward only) push: remote (default origin), branch, setUpstream reset_hard: revision (default HEAD) clean: dryRun (default true), paths (array) branch_delete: name* RETURNS: result and the output of git.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspace": "<workspace>",
"action": "<action>",
"purpose": "<purpose>"
},
"name": "cmd_git"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guide | No | true: put the commands guide first in the result. Use on your first commands call, or when told it changed. | |
| action | Yes | One of: status, diff, log, show, branches, stashes, remotes, add, commit, branch_create, branch_switch, stash_push, stash_pop, restore, pull, push, reset_hard, clean, branch_delete | |
| purpose | Yes | One sentence: why you run this. The owner reads it before approving, sees it live, and it is kept in the audit log. | |
| workspace | Yes | Workspace name as shown in Waymark (a single workspace; '*' is not accepted) | |
| optionsJson | No | JSON object with the options of the action, for example {"message":"Fix null check"}. Omit when none are needed. | |
| waitSeconds | No | Seconds to wait for the result before returning a run id (default 30, at most about 45). The command keeps running; use cmd_wait to wait longer. |