Gemini CLI

API keys for Gemini CLI in the cloud and in CI, without stored provider keys

Gemini CLI runs wherever you start it: your terminal, a remote machine, or a GitHub Actions workflow. Away from your laptop, the question is the same as for every agent: where do the API keys come from? This page explains the usual setup and where Shipkey fits.

How the Gemini CLI environment works

In the cloud, Gemini CLI most often runs in GitHub Actions through the run-gemini-cli action, on a runner that starts from nothing each time. The runner gets what the workflow gives it: the repository, the tools the job installs and the secrets the workflow passes in.

What it gives you for secrets

Gemini CLI itself signs in with a GEMINI_API_KEY stored as a repository secret, or without a stored key through Google's Workload Identity Federation. Every other key the agent's commands need (another model provider, a media API, a deploy token) is one more repository secret handed to a process that reads issues, pull requests and web pages.

From the product's documentation, as read in December 2026: github.com/google-github-actions/run-gemini-cli

Where Shipkey fits

  • Install shipkey as a Gemini CLI extension. The commands the agent runs get tokens that last hours, in place of stored provider keys.
  • You approve each environment with a passkey, and can revoke it with one action.
  • The real keys stay in your gateway, a Cloudflare Worker in your own account.
  • For deploys, the issuer can give a workflow a token for a single Worker after you approve the commit.

Set it up for Gemini CLI

  1. 1.Deploy the Shipkey issuer and gateway, two Cloudflare Workers, in your own account, and register your passkey as the approver. Self-hosting guide

  2. 2.Add the Shipkey plugin to the agent and tell it your issuer's address.

  3. 3.A runner starts from nothing, so give it SHIPKEY_ISSUER and the environment key you received at approval; it then renews without asking.

  4. 4.Approve the environment with your passkey when the agent shows the check code. From then on its commands go through your gateway.

Other cloud environments