Google sunsets Gemini CLI on 2026-06-18 in favor of Antigravity. If you are migrating, see Antigravity; its
agy CLI reads the same ~/.gemini/GEMINI.md guideline this adapter writes.Setup
1
Start agentmemory
2
Wire MCP
~/.gemini/, backs up settings.json, merges the entry, and verifies it after writing. Gemini’s own CLI form works too: gemini mcp add agentmemory npx -y @agentmemory/mcp --scope user.3
Restart Gemini CLI
Start a new
gemini session and run /mcp to confirm the server and its tools are listed.4
Verify
Ask the agent to save a fact with
memory_save, then:What connect writes
~/.gemini/settings.json
Capture model
Gemini CLI is MCP-only: no lifecycle hooks fire, so the agent must call the tools itself.connect therefore upserts a marked memory-usage block into the global ~/.gemini/GEMINI.md, which Gemini injects into every session. The block tells the agent to recall at task start and save durable facts. Re-running connect updates only the marked block; the rest of your GEMINI.md is untouched. Skip with --no-guidelines.
Troubleshooting
/mcp does not list agentmemory
/mcp does not list agentmemory
Gemini reads
settings.json at startup. Exit and restart the CLI. If the entry is present but the server fails to spawn, run npx -y @agentmemory/mcp manually to surface the error.src/cli/connect/gemini-cli.ts (shared JSON adapter) and src/cli/connect/guidelines.ts.