Announcing `gemini-cli`: A Command-Line Tool for the Google Gemini API

I’m excited to announce the release of gemini-cli, a new command-line interface for the Google Gemini API. This tool is designed for developers who want a powerful, portable, and feature-rich way to interact with Gemini models directly from their terminal.

gemini-cli is more than just a simple wrapper around the API. It provides an interactive, shell-like experience with a host of features designed to streamline your workflow and enhance your productivity.

Key Features:

  • Conversation History: Keep track of your conversations and refer back to previous interactions with ease.
  • Configurable Models and Parameters: Switch between different Gemini models and adjust parameters like temperature on the fly.
  • File Attachments: Attach files, including pasted text, directly to your prompts.
  • System Prompts: Set a system-level prompt to guide the model’s behavior throughout a conversation.
  • Gzip Compression: Efficiently handle large requests with automatic Gzip compression.
  • Cross-Platform: gemini-cli is designed to be portable between POSIX systems (Linux, macOS) and Windows.
  • Session Management: Save, load, and manage your conversations as named sessions.
  • API Key Management: Securely manage multiple API keys.
  • Export to Markdown: Easily export your conversations to Markdown for documentation or sharing.
  • Free Mode: Access a key-free mode for quick, unauthenticated requests.

gemini-cli is built to be a flexible and powerful tool for any developer working with the Gemini API. Whether you’re building complex applications or just want a quick way to experiment with different prompts, gemini-cli has you covered.

The Gemini API offers a wide range of capabilities, from fine-tuning models to understanding video, images, and audio. It supports both free and paid tiers, with Gemini 1.5 Flash being a competitively priced option for many use cases. The API is also well-documented, making it easy for developers of all skill levels to get started.

You can find the source code and installation instructions on the project’s GitHub page. I welcome any feedback or contributions to help make this tool even better.

1 Like