@forge tool brings your Git forge into the agent loop. It runs pull-request, issue and CI operations through the CLI you already authenticated — gh for GitHub, glab for GitLab — so the agent can close the daily loop branch → PR → watch CI → fix without you switching windows.
@forge is keyless by design. ChatCLI never stores a forge token: it shells out to the gh/glab binary the user logged in with (gh auth login / glab auth login). Whatever those CLIs can do with your account, @forge can do — nothing more, nothing less.Prerequisites
@forge needs the forge’s official CLI installed and authenticated on your machine:
1
2
Authenticate once
3
Run inside a repository
@forge reads the origin remote to decide GitHub vs GitLab, so run the agent from a cloned repo (or pass host explicitly).Usage
{cmd, args} and a flat argv form are accepted, and the two-token spelling folds into the canonical command — pr view 42 is the same as pr-view 42.
Subcommands
GitHub or GitLab — decided for you
@forge picks the backend automatically:
1
Explicit host wins
Pass
{"host":"github"} or {"host":"gitlab"} to force gh or glab for that call.2
Otherwise, the git remote decides
An
origin remote pointing at a GitLab URL routes to glab; anything else defaults to gh (GitHub).@forge maps the GitLab vocabulary for you: a PR becomes a merge request (pr-* → mr), a comment becomes a note, and --base becomes --target-branch. You write one set of commands; the right CLI runs underneath.
Worked example: fixing a red PR without leaving the agent
Security
- Reads are auto-approved.
pr-list,pr-view,pr-diff,pr-checks,issue-list,issue-view,ci-status,ci-logsanddetectonly observe forge state, so they run without a confirmation prompt and can be batched. - Mutations hit the security gate.
pr-create,pr-commentandissue-commentchange what other people see, so they go through the same confirmation policy as any other side-effecting tool call — you (or your policy) approve each one. - Nothing is ever escalated silently: unparseable arguments fail closed (treated as not read-only), and the tool never invents a token — it can only do what your logged-in
gh/glabcan.
@forge output is capped to keep large PR diffs and CI logs from flooding the context. For a full diff, the agent can fall back to @coder git-diff on a checked-out branch.Next Steps
Agentic Plugins
The full builtin tool catalog and how the agent uses them.
Coder Mode Security
How the security gate arbitrates mutating tool calls.