A ready-to-use and convenient Docker environment for Google's Gemini CLI (@google/gemini-cli).
This project provides Docker images that allow you to use the Gemini CLI without a local Node.js installation. Designed with security and convenience in mind, these images run as a non-root user and offer variants for different use cases, from minimal execution to a full development environment integrated with VS Code Dev Containers.
For detailed documentation on how to use, configure, and contribute to this project, please refer to the project documentation.
To get started quickly, ensure you have Docker installed and a Gemini API key.
-
Prerequisites:
-
Initial Setup:
In your home directory, create a
.env.geminifile for your API key and a.geminidirectory to persist chat history and settings.echo "GEMINI_API_KEY=YOUR_API_KEY_HERE" > ~/.env.gemini mkdir -p ~/.gemini
-
Run Gemini CLI:
Execute the following command to start the Gemini CLI. It mounts your current directory and persists your settings and history.
docker run -it --rm \ --env-file ~/.env.gemini \ -v "~/.gemini:/home/node/.gemini" \ -v "$(pwd):/workspace" \ -w "/workspace" \ naoyoshinori/gemini-cli:0-node \ gemini
For more detailed instructions and other use cases, see the Getting Started Guide.
This project offers three main image variants to suit different needs. For a comprehensive explanation of each, please refer to the Image Variants documentation.
node: A minimal image ideal for direct execution and CI/CD.javascript-node: Includes common JavaScript development tools, recommended for VS Code Dev Containers.typescript-node: Adds TypeScript-specific tools for a richer development environment.
- The Google Gemini CLI is licensed under the Apache 2.0 License.
- The Dockerfile and associated scripts for this project are licensed under the MIT License.
- As with all Docker images, this image contains other software under other licenses (e.g., the base OS distribution and its dependencies).
Interested in contributing to this project? Please see CONTRIBUTING.md for details.