Git Workspace
Local git operations model — clone, branch, read, commit, push, rebase. Designed for agent-driven development workflows where code changes are authored locally and pushed to a remote forge. Supports a configurable workspace layout (default: $HOME/{host}/{group}/{project}) and commit message format enforcement.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| host | string | Git remote host (e.g. gitlab.example.com, codeberg.org). Used to construct clone URLs and workspace paths. |
| baseDir? | string | Base directory for workspaces. Default: $HOME. Repos are placed at {baseDir}/{host}/{group}/{project}. |
| defaultBranch? | string | Default branch name (default: main). Used as the base for new branches. |
| commitFormat? | string | Commit message format hint for the agent. Example: 'leading-verb, 50 char title, blank line, body explains why'. |
| protocol? | enum | Clone protocol. 'ssh' (default) uses git@host:project.git; 'https' uses https://host/project.git. |
| Argument | Type | Description |
|---|---|---|
| project | string | Project path (e.g. myorg/my-repo, team/infra-dns). |
| localPath? | string | Override the computed local path. |
| protocol? | enum | Override the global clone protocol for this project. |
| ref? | string | Checkout this branch/tag after clone or fetch instead of the default branch. |
| Argument | Type | Description |
|---|---|---|
| project | string | Project path. |
| branch | string | Branch name to switch to or create (e.g. feat/add-txt-record). |
| localPath? | string | Override the computed local path. |
| Argument | Type | Description |
|---|---|---|
| project | string | Project path. |
| path | string | File path relative to repo root. |
| localPath? | string | Override the computed local workspace path. |
| Argument | Type | Description |
|---|---|---|
| project | string | Project path. |
| pattern? | string | Glob pattern or directory (e.g. 'terraform/**/*.tf'). Default: all tracked files. |
| localPath? | string | Override the computed local workspace path. |
| Argument | Type | Description |
|---|---|---|
| project | string | Project path. |
| message | string | Commit message. |
| files? | array | Files to stage (relative to repo root). Omit to stage all changes. |
| amend? | boolean | Amend the last commit instead of creating a new one. Default: false. |
| localPath? | string | Override the computed local workspace path. |
| Argument | Type | Description |
|---|---|---|
| project | string | Project path. |
| force? | boolean | Force push (--force-with-lease). Default: false. |
| localPath? | string | Override the computed local workspace path. |
| Argument | Type | Description |
|---|---|---|
| project | string | Project path. |
| localPath? | string | Override the computed local workspace path. |
| Argument | Type | Description |
|---|---|---|
| project | string | Project path. |
| ref? | string | Ref to diff against (e.g. origin/main, HEAD~1). Default: working tree diff. |
| nameOnly? | boolean | Only list changed file names, no patch content. Default: false. |
| localPath? | string | Override the computed local workspace path. |
| Argument | Type | Description |
|---|---|---|
| project | string | Project path. |
| onto? | string | Branch to rebase onto (e.g. main, origin/main). Default: auto-detected default branch. |
| localPath? | string | Override the computed local workspace path. |
Resources
Add forge ref fetching to the branch method. GitLab MR refs (merge-requests/N/head) and GitHub/Forgejo PR refs (pull/N/head) are now explicitly fetched and checked out in detached HEAD mode. Previously these refs were silently missed by the default fetch refspec, causing the method to fall through to creating a new branch from default. Output schema adds optional 'detached: true' field when on a forge ref.
Modified 1 behaviors
Modified 1 behaviors
Add rm method: stage file deletions via git rm for subsequent commit.
Modified 1 behaviors
Modified 1 behaviors
Fix instance name sanitization (slashes in project paths and branch names caused writeResource failures). Add test coverage for the bug. 12 tests passing.
Auto-detects default branch from remote HEAD. Sanitized resource instance names. Generic docs.
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License1/2partial
no SPDX license declared
- Verified public repository2/2earned