Skip to content

Gemini CLI

Gemini CLI signed in with Google talks to Gemini Code Assist. Point it at the proxy’s google-code-assist path and add your Milgram API key as a custom header. Your Google sign-in keeps working and is forwarded upstream.

Add these lines to ~/.gemini/.env. Gemini CLI loads only the first of a project’s .gemini/.env or .env, else ~/.gemini/.env, and only in folders you trust: merge the same lines into a project’s own file if it has one, and trust the folder.

~/.gemini/.env
CODE_ASSIST_ENDPOINT=https://api.milgram.dev/v1/proxy/google-code-assist
GEMINI_CLI_CUSTOM_HEADERS="x-milgram-api-key: mlg_YOUR_KEY"

Start gemini and send a prompt. The session appears in the console under Sessions.