Skip to main content
The @forge tool brings your Git forge into the agent loop. It runs pull-request, issue and CI operations through the CLI you already authenticatedgh 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.

Prerequisites

@forge needs the forge’s official CLI installed and authenticated on your machine:
1

Install the CLI

GitHub: install gh. GitLab: install glab. Either is enough — @forge picks the right one automatically (see below).
2

Authenticate once

ChatCLI reuses this session. There is nothing to configure inside ChatCLI and no token to paste.
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

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.

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).
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.

Worked example: fixing a red PR without leaving the agent

The same flow works on GitLab merge requests unchanged — only the underlying CLI differs.

Security

  • 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.

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.