Gemini CLI
Gemini CLI sessions start with your project's brief and save as you go.
In Gemini CLI, every session starts with the brief, and your work is saved after each response,
before a compression and when the session closes. Type /gw to resume or save.
npx groundwork-ai init --adapter gemini # or: npx groundwork-ai adapter add geminiStart Gemini CLI in the project root. Gemini CLI asks you to accept project hooks, and asks again when one changes.
Google's docs say Gemini CLI stays available with paid API keys, and that Antigravity CLI replaced it for other users. Antigravity CLI has no adapter.
What happens when
| When | Hook | What happens |
|---|---|---|
| A session starts, resumes or is cleared | SessionStart | The brief goes into the session |
| The agent finishes a response | AfterAgent | A checkpoint. If the handoff is behind, Gemini CLI retries with a reminder to save, once per commit |
| Before a compression | PreCompress | A checkpoint only. The summary is not told what to keep |
| The session ends | SessionEnd | A last checkpoint, best effort: the CLI does not wait for it |
You type /gw | Command | Resume from memory, or save |
These hooks never block your work. After a compression nothing re-adds the brief, so AGENTS.md
tells the agent to run npx groundwork-ai brief.
Files it writes
| Path | What it is |
|---|---|
.gemini/settings.json | The hooks. Merged into your file, never replaced |
.gemini/hooks/groundwork.mjs | A small script that hands Groundwork's text to Gemini CLI in the form it expects |
.gemini/commands/gw.toml | The /gw command |
GEMINI.md | Imports AGENTS.md. An existing GEMINI.md keeps your text |
With the optional flow on
init --flow or flow on adds:
| Added | What it does |
|---|---|
/gw-approve, /gw-reject | Commands you type |
.gemini/agents/gw-*.md | Tester, implementer and reviewer subagents |
BeforeTool guard | Runs the commit gate, protects Groundwork's own files, and runs your guards for shell commands, write_file and replace |
What Gemini CLI does not enforce:
| Gap | What it means |
|---|---|
| The guard is not fail-closed | A guard that can't start lets the call through. MCP tools aren't checked |
| Approvals aren't bound to your message | The commit gate can't tell that a human approved |
| The approval commands aren't human-only | The documentation doesn't say whether the model can run one |
| The reviewer isn't read-only | It has a shell to run the checks, and a shell can write |
init --flow and flow on print this list.
Status
Built from Gemini CLI's documentation, read on 2026-11-15. Not yet run inside a live Gemini CLI
session. Run npx groundwork-ai doctor after your first one.