Skip to content

code-with-aneesh/gemini-cli-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gemini CLI

Gemini CLI is a command-line tool to interact with Google's Gemini models via their REST API.
It supports plain and pretty markdown output, customizable model selection, and flexible prompt input via arguments or piped stdin.

Features

  • Send prompts to Gemini models using the Google Generative Language API.
  • Output responses as plain text or pretty markdown (rendered via glow if installed).
  • Choose model and request timeout via CLI flags.
  • Accept prompt as CLI arguments or from piped stdin.

Usage

# Basic usage with prompt as arguments
gemini your prompt here

# Pretty markdown output (requires glow)
gemini -l your prompt here

# Specify model and timeout
gemini -m gemini-2.5-pro -l --timeout 30 your prompt here

# Pipe prompt from stdin
echo "What is Rust?" | gemini

Installation

  1. Clone the repository:
    sh git clone https://github.com/yourusername/gemini-cli.git cd gemini-cli

  2. Set your Gemini API key:
    sh export GEMINI_API_KEY=your_api_key_here

  3. Build the project:
    sh cargo build --release

  4. (Optional) Install glow for pretty markdown rendering.

CLI Options

  • -l, --long — Pretty markdown output (opens via glow if available)
  • -m, --model — Model name (default: gemini-2.5-flash)
  • --timeout — Request timeout in seconds (default: 60)
  • prompt — Everything after gemini is treated as the prompt. If omitted, reads from STDIN.

Example

sh gemini -l -m gemini-2.5-pro "Explain ownership in Rust"

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages