Skip to main content

CLI tool for interacting with Gemini 2.5 Pro

Project description

Gemini Code

A powerful AI coding assistant for your terminal, powered by Gemini 2.5 Pro with support for other LLM models.

Features

  • Interactive chat sessions in your terminal
  • Multiple model support (currently Gemini 2.5 Pro, more coming soon)
  • Intelligent context management with auto-compaction warnings and the /compact command
  • Markdown rendering in the terminal
  • Automatic tool usage by the assistant:
    • File operations (view, edit, list, grep, glob)
    • System commands (bash)
    • Web content fetching

Installation

# Clone the repository
git clone https://github.com/raizamartin/gemini-code.git
cd gemini-code

# Install the package
pip install -e .

Setup

Before using Gemini CLI, you need to set up your API keys:

# Set up Google API key for Gemini models
gemini setup YOUR_GOOGLE_API_KEY

Usage

# Start an interactive session with the default model
gemini

# Start a session with a specific model
gemini --model gemini-2.5-pro

# Set default model
gemini set-default-model gemini-2.5-pro

Interactive Commands

During an interactive session, you can use these commands:

  • /exit - Exit the chat session
  • /help - Display help information
  • /compact - Summarize the conversation to reduce token usage

How It Works

Tool Usage

Unlike direct command-line tools, the Gemini CLI's tools are used automatically by the assistant to help answer your questions. For example:

  1. You ask: "What files are in the current directory?"
  2. The assistant uses the ls tool behind the scenes
  3. The assistant provides you with a formatted response

This approach makes the interaction more natural and similar to how Claude Code works.

Context Management

Gemini CLI intelligently manages the conversation context:

  1. Warning Threshold (80%): When you reach 80% of the token limit, you'll see a warning panel suggesting to use /compact
  2. Auto-Compact Prompt (95%): At 95% of the limit, the CLI will ask if you want to automatically compact the conversation
  3. Manual Compaction: You can use /compact at any time to summarize the conversation and reduce token usage

The summarization process preserves important context while significantly reducing token count, allowing for virtually unlimited conversation length.

Development

This project is under active development. More models and features will be added soon!

License

MIT

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gemini_code-0.1.8.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gemini_code-0.1.8-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file gemini_code-0.1.8.tar.gz.

File metadata

  • Download URL: gemini_code-0.1.8.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for gemini_code-0.1.8.tar.gz
Algorithm Hash digest
SHA256 8fb5edaf1034efff4cff4e690ce277a4edd385fb95b76cadc5925fe4d2b2e14f
MD5 a7cbbe4561a5ae00ed69aa58ad75f6b6
BLAKE2b-256 aa578896af4641a5318ae84c753dd72f3a54f8f22507f8588a631ff3bd4353e0

See more details on using hashes here.

File details

Details for the file gemini_code-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: gemini_code-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for gemini_code-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 57d5f499443b76f24d8c61561c9b208b358e317f3bf88ff804f2498824651c82
MD5 6f4ed9d0f7b8fa0c4a8e2e28aa5c1031
BLAKE2b-256 5b8ff0c39da1e4bedbb99ef2d26f7851f17c088213b6ecd4bb013ec0a61711c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page