Metadata-Version: 2.4
Name: gemini-code
Version: 0.1.17
Summary: CLI tool for interacting with Gemini models
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: click>=8.0.0
Requires-Dist: rich>=10.0.0
Requires-Dist: google-generativeai>=0.3.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: tiktoken>=0.4.0
Requires-Dist: requests>=2.25.0
Requires-Dist: html2text>=2020.1.16

# Gemini Code

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

## Features

- Interactive chat sessions in your terminal
- Multiple model support (currently Gemini 1.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

```bash
# 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:

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

## Usage

```bash
# Start an interactive session with the default model
gemini

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

# Set default model
gemini set-default-model gemini-1.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!

### 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:
  ```bash
  rm -rf ~/.config/gemini-code
  ```

## License

MIT
