Pull requests, issues and CI through the user’s own authenticated gh/glab CLI — read a PR’s checks, pull the failing run’s logs, comment and open PRs, without leaving the agent. Keyless: ChatCLI never stores forge credentials.
The @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.
The typical use is debugging a red PR: @forge pr-checks 42 shows which checks failed, @forge ci-logs <run-id> pulls only the failing steps’ logs, the agent fixes the code, and @forge pr-comment 42 --body "…" reports back.
<tool_call name="@forge" args='{"cmd":"pr-checks","args":{"number":42}}' /><tool_call name="@forge" args='{"cmd":"ci-logs","args":{"run":123456}}' /><tool_call name="@forge" args='{"cmd":"pr-comment","args":{"number":42,"body":"CI is green now — the flaky test was reseeded."}}' />
Both the JSON envelope {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.
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).
The command surface is identical across both — @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.
<tool_call name="@forge" args='{"cmd":"detect"}' />→ Forge CLI: glab (origin remote is a GitLab URL)
Reads are auto-approved.pr-list, pr-view, pr-diff, pr-checks, issue-list, issue-view, ci-status, ci-logs and detect only observe forge state, so they run without a confirmation prompt and can be batched.
Mutations hit the security gate.pr-create, pr-comment and issue-comment change 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/glab can.
@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.