Skip to main content

An AI coding assistant CLI using Google's Gemini models with function calling.

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 (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

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.101.tar.gz (32.8 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.101-py3-none-any.whl (37.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gemini_code-0.1.101.tar.gz
  • Upload date:
  • Size: 32.8 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.101.tar.gz
Algorithm Hash digest
SHA256 5fefff92a2c2186f870c1f1dd5d7aabbcbe4b106adff69d358854baceaa9cf61
MD5 d2f3cca81da90bdfdbff93e37642fab3
BLAKE2b-256 e2eba9fa57b4a86756e61271018fd38dc51a9d7d53bf6242713921eff4e0a955

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gemini_code-0.1.101-py3-none-any.whl
  • Upload date:
  • Size: 37.1 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.101-py3-none-any.whl
Algorithm Hash digest
SHA256 faba61def1d1e2f3df2c84204c50ab399ff92ff133a511717e0a426c539b5eb6
MD5 c5e2805c9e1f94d1e52a060dee6cdbf9
BLAKE2b-256 62f6a1897063c28d271017b9cd23a8d6482d560937bbc18448b79385761bffd2

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