Skip to content

AI assistant · Gemini CLI

Long-term memory for Gemini CLI

One entry in settings.json and a sign-in in your browser. Gemini CLI then searches your memory before it answers and saves what you tell it, in every project.

What it does for Gemini CLI

GEMINI.md holds the instructions you write for Gemini CLI. Alexein holds what it learns along the way and what your connected apps deliver: the decision from yesterday’s review, the flag a teammate mentioned in Slack, the issue you were in the middle of in Linear. Gemini CLI searches it before it guesses, and saves what you tell it.

Switch to Claude Code or Codex for a task and nothing is lost: they read the same memory.

Set it up

  1. Add the alexein entry below under mcpServers in ~/.gemini/settings.json. Use httpUrl, not url: in Gemini CLI, url means an older transport Alexein doesn’t serve.
  2. Start Gemini CLI. It opens Alexein’s sign-in in your browser; if it doesn’t, run /mcp auth alexein.
  3. Sign in, keep Read and save, and select Allow.
  4. Add the five lines from the docs to ~/.gemini/GEMINI.md, then run /memory reload.

Run /mcp: alexein is listed as connected, with its tools.

~/.gemini/settings.json
{
  "mcpServers": {
    "alexein": {
      "httpUrl": "https://api.alexein.ai/v1/mcp"
    }
  }
}

Every step, and a key for scripts and CI, is in the Gemini CLI setup guide.

What you can ask

  • “Pick up where I left off on the importer refactor.” memory_latest shows what happened most recently, and memory_subject the refactor’s story so far.
  • “Which Linear issues assigned to me are still open?” With Linear connected, memory_pending lists them, newest first.
  • “From now on, write commit messages in the imperative.” Saved with memory_add, for this project and every other.

Gemini CLI or Antigravity

In June 2026, Google replaced Gemini CLI with Antigravity for its unpaid tier and Google One users. On those plans, add Alexein to Antigravity instead: its plugin signs in the same way. These steps are for the plans that still have Gemini CLI.

Over SSH or in a container

The sign-in needs a browser on the machine Gemini CLI runs on. On a remote machine or in a container, put a personal key in the entry’s headers instead; Gemini CLI fills it in from an environment variable.

Questions about Gemini CLI

In Gemini CLI, url means the older SSE transport, which Alexein doesn’t serve. httpUrl is the one Alexein speaks.

Choose to always allow the tool when it asks. Setting trust to true on the alexein entry skips every confirmation for this server.

Yes. Antigravity takes Alexein’s plugin with one agy command, and you sign in; there is no key.

Give Gemini CLI a memory.

Sign up for My memory, add one entry to settings.json, and Gemini CLI starts from what you’ve already told it.