gem-cli is a command-line AI assistant powered by Google Gemini.
Follow these steps to install gem-cli on your system.
- Download the script:
curl -LO https://raw.githubusercontent.com/jorexdeveloper/gemini-cli/main/gem-cli
- Make it executable:
chmod +x gem-cli
- Move it into your
PATH:sudo mv gem-cli /usr/local/bin/
- Bash 4+
- curl
- jq
- fmt
- bat (for pretty output)
- xclip or xsel (for clipboard support)
Configure gem-cli to work with your Google Gemini API key and preferences.
Set your Gemini API key via environment variable or file.
-
Get free API key here
-
Environment Variable:
export GEMINI_API_KEY="your_api_key_here"
-
Key File (
~/.gemini.key):echo "your_api_key_here" > ~/.gemini.key
- Chat History
Stored at
~/.local/share/gem-cli/history/chat.jsonby default. - Response Saving
Saved at
~/.local/share/gem-cli/responses/when enabled. - Log Level
Adjust verbosity with
-L(0–5).
Invoke gem-cli with options and an optional prompt.
gem-cli [OPTIONS] [PROMPT]| Flag | Description |
|---|---|
-m NAME |
Set the API model (e.g., gemini-2.5-flash). |
-i |
Force interactive mode. |
-c |
Print current chat history. |
-n |
Backup and start a new chat. |
-N |
Start new chat without backup. |
-p |
Private chat (disable history & response saving). |
-d |
Disable chat history. |
-s |
Show separator between messages. |
-r |
Prefer raw output (no pretty printing). |
-R |
Prefer raw input (disable slash commands). |
-j |
JSON output (implies raw output). |
-q |
Quiet mode (suppress startup messages). |
-Q |
Quiet + raw output. |
-l |
List supported API models. |
-L INT |
Set log level (0=NONE to 5=DEBUG). |
-v |
Print version and exit. |
-h |
Print help and exit. |
Launch a REPL chat session. Omit a prompt or use -i to force interactive mode.
gem-cliKey commands in session:
/help– Show available commands./model NAME– Switch API model./raw– Toggle raw output mode./clear– Clear current chat./list– List supported models./exit– End the session.
Send a single prompt and exit.
gem-cli "Explain quantum computing in simple terms."Combine with flags:
gem-cli -j -m gemini-2.5-flash "Generate a meal plan for a vegetarian."Manage conversation logs and responses with ease.
- View History
gem-cli -c
- New Chat with Backup
gem-cli -n
- New Chat without Backup
gem-cli -N
Fetch and display models supported for generation.
gem-cli -lAdd -j for a JSON list or use -ll to print simple model list.
- Quick fact queries
- Multi-turn AI conversations
- Scripted API calls in shell pipelines
- Generating formatted reports or code snippets
gem-cli is licensed under GPL v3+. © 2025 Jore – GitHub/jorexdeveloper/gemini-cli