Skip to main content
Gemini CLI talks Google’s native generateContent API, so the resource you point it at needs a Google Gemini (or Vertex AI) provider attached. See AI Gateway Overview if you haven’t set that up yet. You’ll need the resource’s URL (its <endpoint>) and its API key (<key>). Both are on the resource’s Keys page.
Public vs. private resourcesWherever these instructions show <key>, what you put there depends on the resource type:
  • Public resource - reachable from anywhere, so the gateway checks a virtual API key. Copy it from the resource URL after login, the Resource Launcher more-info panel, or https://app.pangolin.net/<org-id>/keys (use your self-hosted dashboard URL in place of app.pangolin.net if you self-host).
  • Private resource - only reachable from devices connected to your Pangolin network, so no key is checked. You must have the Pangolin client installed and connected. Use the literal string none as the key.
Don’t delete the key field for private resources. Most clients refuse to start without some key set, so they need an inert placeholder rather than a missing one.

Fastest: Pangolin CLI

Install the Pangolin CLI if you don’t have it, then log in:
Configure Gemini CLI against a resource:
This prompts you to pick an organization and resource if you have more than one, fetches a key for you if the resource needs one, and writes ~/.gemini/.env - the file Gemini CLI loads automatically on every run, regardless of which directory you start it from. To skip the prompts:
To undo it:

Manual setup

Write ~/.gemini/.env:
Gemini CLI also checks a project-local .env first (in the current directory or a parent, up to .git or your home directory) before falling back to ~/.gemini/.env, so a project-level file with the same two lines overrides this for just that project. Or, for a one-off shell session instead of a permanent file:
For a private resource, keep GEMINI_API_KEY in place and set it to none. Gemini CLI won’t start without it set to something.