Skip to main content

Gemini Code

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

Features

  • Interactive chat sessions in your terminal
  • Multiple model support (Gemini 2.5 Pro, Gemini 1.5 Pro, and more)
  • Basic history management (prevents excessive length)
  • Markdown rendering in the terminal
  • Automatic tool usage by the assistant:
    • File operations (view, edit, list, grep, glob)
    • Directory operations (ls, tree, create_directory)
    • System commands (bash)
    • Quality checks (linting, formatting)
    • Test running capabilities (pytest, etc.)

Installation

Method 1: Install from PyPI (Recommended)

# Install directly from PyPI
pip install gemini-code

Method 2: Install from Source

# 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 models/gemini-2.5-pro-exp-03-25

# Set default model
gemini set-default-model models/gemini-2.5-pro-exp-03-25

# List all available models
gemini list-models

Interactive Commands

During an interactive session, you can use these commands:

  • /exit - Exit the chat session
  • /help - Display help information

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.

Development

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

Recent Changes in v0.1.69

  • Added test_runner tool to execute automated tests (e.g., pytest)
  • Fixed syntax issues in the tool definitions
  • Improved error handling in tool execution
  • Updated status displays during tool execution with more informative messages
  • Added additional utility tools (directory_tools, quality_tools, task_complete_tool, summarizer_tool)

Recent Changes in v0.1.21

  • Implemented native Gemini function calling for much more reliable tool usage
  • Rewritten the tool execution system to use Gemini's built-in function calling capability
  • Enhanced the edit tool to better handle file creation and content updating
  • Updated system prompt to encourage function calls instead of text-based tool usage
  • Fixed issues with Gemini not actively creating or modifying files
  • Simplified the BaseTool interface to support both legacy and function call modes

Recent Changes in v0.1.20

  • Fixed error with Flask version check in example code
  • Improved error handling in system prompt example code

Recent Changes in v0.1.19

  • Improved system prompt to encourage more active tool usage
  • Added thinking/planning phase to help Gemini reason about solutions
  • Enhanced response format to prioritize creating and modifying files over printing code
  • Filtered out thinking stages from final output to keep responses clean
  • Made Gemini more proactive as a coding partner, not just an advisor

Recent Changes in v0.1.18

  • Updated default model to Gemini 2.5 Pro Experimental (models/gemini-2.5-pro-exp-03-25)
  • Updated system prompts to reference Gemini 2.5 Pro
  • Improved model usage and documentation

Recent Changes in v0.1.17

  • Added list-models command to show all available Gemini models
  • Improved error handling for models that don't exist or require permission
  • Added model initialization test to verify model availability
  • Updated help documentation with new commands

Recent Changes in v0.1.16

  • Fixed file creation issues: The CLI now properly handles creating files with content
  • Enhanced tool pattern matching: Added support for more formats that Gemini might use
  • Improved edit tool handling: Better handling of missing arguments when creating files
  • Added special case for natural language edit commands (e.g., "edit filename with content: ...")

Recent Changes in v0.1.15

  • Fixed tool execution issues: The CLI now properly processes tool calls and executes Bash commands correctly
  • Fixed argument parsing for Bash tool: Commands are now passed as a single argument to avoid parsing issues
  • Improved error handling in tools: Better handling of failures and timeouts
  • Updated model name throughout the codebase to use gemini-1.5-pro consistently

Known Issues

  • If you created a config file with earlier versions, you may need to delete it to get the correct defaults:
    rm -rf ~/.config/gemini-code
    

License

MIT

Metadata

Release files for gemini-code 0.1.106

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gemini-code 0.1.106
File Size Uploaded Provenance
gemini_code-0.1.106.tar.gz 33.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gemini-code 0.1.106
File Interpreter ABI Platform
gemini_code-0.1.106-py3-none-any.whl Python 3 none any Details

Total release size: 70.5 kB

Release files / gemini_code-0.1.106.tar.gz

Download URL gemini_code-0.1.106.tar.gz
Size 33.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8438fb40cccec66766834db000e2afc1e53c5bb837512d59e35f5d2bd9adba1b
BLAKE2b-256 checksum
How to use checksums
e6e8b4bd4180d587ad665e4fc79f3cd3af16b504c6613cc95cfea1c693ec91e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / gemini_code-0.1.106-py3-none-any.whl

Download URL gemini_code-0.1.106-py3-none-any.whl
Size 37.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9adad9758d6320a1e37f971f9406980b8808955f69d5760f9533440ae8c878bf
BLAKE2b-256 checksum
How to use checksums
cdd257dc47efbbea2dd42f1c39aed05c76fa97f82bd05b3fa699e452b52cf426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Security for gemini-code 0.1.106

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.106 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page