A command-line interface for Google's Gemini API inspired by Claude Code.
- Interactive command-line interface for Google's Gemini API
- Support for different Gemini models (gemini-pro, gemini-pro-vision, gemini-flash, gemini-2.5-pro-preview-05-06)
- Streaming responses for real-time interaction
- Conversation history tracking
- File and directory analysis capabilities
- Easy API key configuration
- Node.js (v14 or later)
- Python (v3.8 or later)
- Google Gemini API key
-
Clone this repository:
git clone https://github.com/RRocaP/gemini-cli.git cd gemini-cli
-
Install Node.js dependencies:
npm install
-
Install Python dependencies:
cd proxy pip install -r requirements.txt cd ..
-
Create your environment configuration file:
cp .env.example .env
-
Edit the
.env
file and add your Gemini API key:GEMINI_API_KEY=your-gemini-api-key-here
First, start the proxy server that communicates with the Gemini API:
npm run start-proxy
This will start a FastAPI server at http://localhost:8000.
In a new terminal, start the Gemini CLI:
npm start
For more options:
npm start -- --help
--model, -m
: Select the Gemini model to use (default: gemini-2.5-pro-preview-05-06)--temperature, -t
: Set the temperature for response generation (default: 0.7)--stream, -s
: Enable/disable streaming responses (default: true)--file, -f
: Process a file or directory
Example:
npm start -- --model gemini-2.5-pro-preview-05-06 --temperature 0.9 --file ./my-project
Within the CLI, you can:
- Type your query and press Enter to get a response
- Type "exit" or press Ctrl+C to quit
This implementation includes:
- File Tools: Capabilities to read, write, and manipulate files from the CLI
- Search Tools: Grep-like functionality for code search
- Project Analysis: Basic project structure analysis
- Command Execution: Run shell commands from within the CLI
- Tool Extension: Easy to extend with more tools
Future enhancements could include:
- Visualizations: Support for image processing and generation
- Package Management: Support for installing and managing packages
- Plugin System: Allow community plugins for extended functionality
MIT
- Inspired by Anthropic's Claude Code
- Powered by Google's Gemini API, featuring the latest models like gemini-2.5-pro-preview-05-06