Skip to content

Smthbig/gemini-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Terminal Gemini AI CLI – v4.2

Terminal-based AI assistant powered by Gemini 2.5 with Copilot mode, file analysis, code generation/improvement, and persistent conversations.


πŸ“‚ File: gmcli.sh

Author: Mohan Sharma
License: MIT
Dependencies: bash, curl, jq


πŸš€ Features

  • πŸ” Secure API key storage
  • 🧠 Chat with Gemini 2.5 (Flash model)
  • πŸ“œ Persistent conversation history
  • ✨ Copilot mode: generate, explain, or improve code
  • πŸ” Analyze large files in chunks
  • πŸ›  Configurable model, temperature, and max tokens
  • πŸ“ Save/load instructions for system behavior
  • 🧹 Automatic summarization of long chat history

πŸ“¦ Installation

curl -o gmcli.sh https://raw.githubusercontent.com/mrajauriya/gmcli/main/gmcli.sh
chmod +x gmcli.sh
./gmcli.sh

Make sure you have jq and curl installed.

Install them on Termux:

pkg install jq curl

Or on Debian/Ubuntu:

sudo apt install jq curl

πŸ›  Setup

On first run, enter your Gemini API key. You can also edit the config later:

echo 'YOUR_API_KEY_HERE' > ~/.smrtask_gemini/config.sh

To change default system instructions:

echo 'You are a helpful assistant.' > ~/.smrtask_gemini/instructions.txt

πŸ§ͺ Usage

Run the script:

./gmcli.sh

Then interact via menu:

  1. Chat with Gemini
  2. View or reset conversation
  3. Copilot coder mode (generate/explain/improve code)
  4. Analyze files
  5. Configure model, tokens, temperature, and instructions

✨ Copilot Mode

  • Generate Code – Provide a description and filename
  • Explain Code – Analyze an existing file line-by-line
  • Improve Code – Give modification instructions for existing files

πŸ“ Config Directory

All settings, history, and instructions are stored in:

~/.smrtask_gemini/
β”œβ”€β”€ config.sh           # API key & model config
β”œβ”€β”€ history.json        # Chat memory
└── instructions.txt    # Custom system instructions

πŸ€– Model Info

By default, uses:

  • Model: gemini-2.5-flash-preview-04-17
  • Max Tokens: 8192
  • Temperature: 0.7
  • Top-K: 1
  • Top-P: 0.95

These can be adjusted in the script menu.


🧠 Chat History

Persistent across sessions and summarized automatically if it grows too long. Summarization keeps the assistant aware of previous context efficiently.


🧹 To Reset Everything

Delete the config directory:

rm -rf ~/.smrtask_gemini

πŸͺͺ License

Apache License Β© Mohan Sharma


Made with ❀️ in Terminal

About

Terminal based ai copilot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages