gemini-cli

Gemini CLI Execution and Deployment

This document describes how to run Gemini CLI and explains the deployment architecture that Gemini CLI uses.

Running Gemini CLI

There are several ways to run Gemini CLI. The option you choose depends on how you intend to use Gemini CLI.


This is the recommended way for end-users to install Gemini CLI. It involves downloading the Gemini CLI package from the NPM registry.


2. Running in a sandbox (Docker/Podman)

For security and isolation, Gemini CLI can be run inside a container. This is the default way that the CLI executes tools that might have side effects.


Contributors to the project will want to run the CLI directly from the source code.


4. Running the latest Gemini CLI commit from GitHub

You can run the most recently committed version of Gemini CLI directly from the GitHub repository. This is useful for testing features still in development.

# Execute the CLI directly from the main branch on GitHub
npx https://github.com/google-gemini/gemini-cli

Deployment architecture

The execution methods described above are made possible by the following architectural components and processes:

NPM packages

Gemini CLI project is a monorepo that publishes two core packages to the NPM registry:

These packages are used when performing the standard installation and when running Gemini CLI from the source.

Build and packaging processes

There are two distinct build processes used, depending on the distribution channel:

Docker sandbox image

The Docker-based execution method is supported by the gemini-cli-sandbox container image. This image is published to a container registry and contains a pre-installed, global version of Gemini CLI.

Release process

The release process is automated through GitHub Actions. The release workflow performs the following actions:

  1. Build the NPM packages using tsc.
  2. Publish the NPM packages to the artifact registry.
  3. Create GitHub releases with bundled assets.