Set up TRW for Gemini CLI
Bring durable engineering memory to Gemini’s native surfaces — a repo-wide instruction file, MCP settings, and role-based subagents, tuned for very large-context sessions.
Prerequisites
- Gemini CLI installed and authenticated.
- Python 3.10+ (3.11+ recommended) and pip 22+.
- A git repository you can write to — TRW writes repo-local files only.
Install
curl -fsSL https://trwframework.com/install.sh | bashWhen the installer prompts for target clients, select Gemini CLI. The bootstrap installs trw-mcp and writes the Gemini-native surface into the repo.
What the installer writes
GEMINI.md— repo-wide instructions with the TRW ceremony protocol. Gemini reads it on startup, so the tool lifecycle is in context from the first turn..gemini/settings.json— registerstrw-mcpundermcpServersvia a JSON deep-merge (only thetrwentry is touched)..gemini/agents/—trw-*.mdrole-based subagent definitions translated from the TRW roster..trw/config.yaml— repo-local TRW config listing Gemini intarget_platforms.
Run your first session
From the project root, start Gemini the way you normally would. It loads GEMINI.md and the MCP server from .gemini/settings.json, which tell the model to begin with trw_session_start().
trw_session_start()— loads prior learnings and any active run state.- Do the work. Checkpoint after each milestone so you can resume after compaction.
trw_learn(summary, detail)whenever you discover a non-obvious gotcha.trw_build_check()thentrw_deliver()to persist state for the next session.
Differences from Claude Code
- MCP lives in
.gemini/settings.json. Gemini registers the server undermcpServersin its settings file — there is no.mcp.jsonat the repo root. - One instruction file.
GEMINI.mdcarries the ceremony protocol, similar in spirit toCLAUDE.md. - Agent teams are a subset. Not all 12 Claude Code specialists translate cleanly to
.gemini/agents/; expect the core roster plus any specialists Gemini can host. - Same memory store. Learnings captured here are visible to every other TRW-wired client in the same repo.
Common problems
Next steps