iCode Workbench · Harness · Gemini CLI
Gemini CLI in iCode Workbench
Gemini CLI is Google's terminal coding agent. In Workbench it runs as a primary harness: each session gets its own Git worktree, the task sits in a durable queue, and the diff is reviewed in the checkout where it was made.
This page is currently available in English only.
What Gemini CLI is good at
- Gemini models. Use your Google account and Gemini model selection; Workbench does not replace the agent or its provider.
- Terminal-native tasks. It reads the repository, edits files, and runs commands from the shell.
- Resumable sessions. Workbench can resume a Gemini CLI session by id when the harness reports one.
Workbench changes where the session runs and how the result is tracked; it does not change Gemini's model behavior or permissions.
Why run it in Workbench
- One worktree per session. Two agents in one checkout can overwrite each other; Workbench gives each its own branch and working directory.
- A durable queue. A session is a process; a task has states. Workbench tracks queued, running, waiting, completed, and failed work.
- A managed status hook. Workbench installs Gemini's status hook at
~/.gemini/settings.json, so the session row can report what the agent is doing. Without the hook, the session staysunknownrather than guessing. - Review in place. Files, Search, and Source Control live beside the terminal, scoped to the session checkout, with line notes and a separate review decision.
Setup
- Install Gemini CLI using Google's official instructions, then confirm
gemini --versionworks in your shell. - Run it once outside Workbench so the CLI's authentication and settings are in place.
- Install the status hook from Workbench's harness settings, and confirm the hook exists in
~/.gemini/settings.json. - Add the repository to Workbench and open it. The harness keeps its own credentials.
If Gemini CLI is installed but Workbench does not see it, check that gemini is on the PATH of the shell Workbench launches. On Windows, a WSL target needs it installed inside the distro.
Launch and resume
Create a new session from New worktree, choose Gemini CLI, and give the task a scope. Workbench launches gemini in the session checkout. Each session is independent: its own branch, its own terminal, its own context.
Workbench uses the resume recipe --resume $TOKEN when a session id was captured. If the app restarts, the detached host keeps the PTY alive; sleep a session to stop the process and keep the checkout, then wake it to resume where the harness supports it.
Status at a glance
The session row shows the project, branch, target, and state. Gemini CLI reports through the managed status hook; a session without the hook stays unknown rather than showing a false running. Sleep a session to stop the process and keep the checkout; wake it to resume where the harness supports it.
A concrete task
Task: “Add cursor-based pagination to the search endpoint.”
- Create a worktree from main and name the branch after the task.
- Scope the session: owned paths
src/search/**and its tests; the public API schema and route table are out of scope. - Launch Gemini CLI in the session checkout with the task statement and the done-when command.
- Queue the task if another session is running; one worktree per task.
- Review the diff in the checkout: run the search tests, check the empty and last-page cases, and look for a changed response shape.
- Decide accept, revise, or reject; merge after the combined result passes.
Pagination is a contract change hidden inside a feature. The review should confirm that existing clients still see the old fields and that the new cursor is optional. The goal is a reviewed diff, not a faster terminal; keep the task small enough to read.
What the managed hook changes
The hook is what turns a terminal into a row with a state. Without it, Workbench can see the process but cannot distinguish running from waiting; the row stays unknown. The hook writes a small config file at ~/.gemini/settings.json and does not proxy model traffic or capture prompts. If you remove it, sessions still run; they just lose the status detail.
If you use Gemini in another IDE at the same time, keep the CLI session in its worktree; the two should not share a checkout.
Limits
- Workbench does not change the agent. Gemini's model behavior, context management, and permissions are its own.
- Desktop only. Workbench is a desktop app; there is no mobile or remote server. If you need those, Orca is the broader tool.
- Pre-1.0. Workbench is still changing; verify current behavior before standardizing a team on it.