Containerpak /
cpak
A fast, decentralized, portable, powerful and low-memory footprint package format for Linux.
59/100 healthLoading repository data…
Zibri / repository
A powerful, portable, and feature-rich command-line client for the Google Gemini API, written in C. Supports interactive chat, scripting, file attachments, and session management with no external runtime dependencies.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Gemini-CLI is a powerful, portable, and feature-rich command-line client for the Google Gemini API. It provides a fluid, shell-like interface for conversing with large language models, designed for developers, writers, and power-users who live in the terminal.
It is written in C for maximum performance and portability, with no dependencies beyond standard system libraries and a few common open-source projects.
/deep, /deeper): An innovative, multi-step prompting technique to elicit higher-quality, more refined responses. The client silently orchestrates a multi-turn conversation where the model iteratively critiques and improves its own answers, finally synthesizing them into a single, optimal response.-f flag. The client automatically falls back to this mode if no API key is provided, making it instantly usable.--add-key, --list-keys, etc.) or an interactive session (/keys ...).cat file | gemini-cli "summarize this").-) to treat standard input as an attachment (git diff | gemini-cli "commit message for: -").-q): Suppresses all informational output, printing only the final model response to stdout.-e): Forces a non-interactive run for a single prompt, even if not using pipes.--save-session.503 Service Unavailable errors.-p flag./attach).First, get the source code using git:
git clone https://github.com/Zibri/gemini-cli.git
cd gemini-cli
You will need a C compiler (gcc or clang) and the development headers for the following libraries:
On Debian/Ubuntu:
sudo apt-get update
sudo apt-get install build-essential libcurl4-openssl-dev libreadline-dev zlib1g-dev
On openSUSE/Tumbleweed:
sudo zypper refresh
sudo zypper install gcc make libcurl-devel readline-devel zlib-devel
On Fedora/CentOS/RHEL:
sudo dnf install gcc make curl-devel readline-devel zlib-devel
On macOS (using Homebrew):
brew install curl readline zlib
# You may need to provide linker flags if they aren't found automatically
On Windows:
The easiest way to build on Windows is by using a POSIX-like environment such as MSYS2.
After installing MSYS2, open the MSYS2 CLANG64 terminal from your Start Menu.
Inside the terminal, use pacman to update the system and install the required compiler and development libraries with this single command:
pacman -Suy libcurl-devel libreadline-devel clang make
Once the installation is complete, you can compile the program by simply running:
make
The project includes a Makefile that automatically detects your operating system and compiles the program with the correct settings. Simply run:```bash
make
This will create an executable named `gemini-cli` (or `gemini-cli.exe` on Windows). You can move this file to a directory in your system's `PATH` (e.g., `/usr/local/bin` or `~/bin`) for easy access.
### 4. Configuration
There are two ways to use the client: with an API key (official API) or without one (unofficial API).
1. **Key-Free Mode (Easiest Start):**
Simply run the client with the `-f` or `--free` flag. If no API key is found from other sources, the client will **automatically fall back** to this mode.
```bash
./gemini-cli -f "Hello, world!"
```
2. **Using an API Key (Official API):**
To use the official Google Gemini API, you need to provide your API key. You can get one from [Google AI Studio](https://aistudio.google.com/app/apikey). The client loads the key in the following order of priority:
* **Environment Variable (Highest Priority):**
Set the `GEMINI_API_KEY` environment variable.
```bash
export GEMINI_API_KEY="your_api_key_here"
```
**For Restricted Keys (Optional):**
If you have secured your API key to an HTTP referrer, set the `GEMINI_API_KEY_ORIGIN` environment variable. This sends the required `Origin` HTTP header.
```bash
export GEMINI_API_KEY_ORIGIN="https://my-app.com"
```
* **Configuration File:**
The client will look for a `config.json` file. You can create this file to set a default model, temperature, API keys, or system prompt.
* **POSIX:** `~/.config/gemini-cli/config.json`
* **Windows:** `%APPDATA%\gemini-cli\config.json`
*Example `config.json`:*
```json
{
"api_keys": [
"your_first_api_key",
"your_second_api_key"
],
"origins": [
"https://your-allowed-origin.com",
"default"
],
"model": "gemini-2.5-pro",
"proxy": "http://localhost:8080",
"temperature": 0.75,
"seed": 42,
"system_prompt": "You are a helpful and concise assistant.",
"google_grounding": true,
"url_context": true,
"max_output_tokens": 8192,
"top_k": 40,
"top_p": 0.95
}
```
* **Interactive Prompt (Last Resort):**
If no key is found and you do not use the `-f` flag, the program will securely prompt you to enter it when it first runs in interactive mode.
## Usage
### Command-Line Arguments
You can control the model and generation parameters at startup using these flags. Any other arguments are treated as an initial prompt or file attachments.
| Flag | Alias | Description | Example |
|---|---|---|---|
| `--help` | `-h` | Show the help message and exit. | `./gemini-cli --help` |
| `--free` | `-f` | Use the unofficial, key-free API endpoint. | `./gemini-cli -f` |
| `--execute` | `-e` | Force non-interactive mode for a single prompt. | `gemini-cli -e "What is 2+2?"` |
| `--quiet` | `-q` | Suppress banners and info for clean scripting output. | `cat file.c | ./gemini-cli -q "summarize"` |
| `--config <path>` | `-c` | Load configuration from a specific file path. | `./gemini-cli -c /path/to/myconfig.json` |
| `--model <name>` | `-m` | Specify the model name to use. | `./gemini-cli -m gemini-2.5-pro` |
| `--proxy <url>` | `-p` | Use a proxy for API requests. | `./gemini-cli -p http://localhost:8080` |
| `--system <prompt>` | `-S` | Set a system prompt for the entire session. | `./gemini-cli -S "You are a C code expert."` |
| `--temp <float>` | `-t` | Set the generation temperature (e.g., 0.0 to 2.0). | `./gemini-cli -t 0.25` |
| `--seed <int>` | `-s` | Set the generation seed for reproducible outputs. | `./gemini-cli -s 1234` |
| `--max-tokens <int>` | `-o` | Set the maximum number of tokens in the response. | `./gemini-cli -o 2048` |
| `--budget <int>` | `-b` | Set the model's max 'thinking' token budget. | `./gemini-cli -b 8192` |
| `--topk <int>` | | Set the Top-K sampling parameter. | `./gemini-cli --topk 40` |
| `--topp <float>` | | Set the Top-P sampling parameter. | `./gemini-cli --topp 0.95` |
| `--no-grounding` | `-ng` | Disable Google Search grounding. | `./gemini-cli -ng` |
| `--no-url-context` | `-nu` | Disable URL context processing. | `./gemini-cli -nu` |
| `--list` | `-l` | List all available models and exit. | `./gemini-cli -l` |
| `--list-sessions` | | List all saved sessions and exit. | `./gemini-cli --list-sessions` |
| `--load-session <name>`| | Load a saved session by name. | `./gemini-cli --load-session my_chat` |
| `--save-session <file>`| | Save conversation from a non-interactive run. | `cat f.c | gemini-cli "prompt" --save-session f.json` |
| `--list-keys` | | List API keys from the configuration file and exit. | `./gemini-cli --list-keys` |
| `--add-key` | | Add a new API key to the configuration file and exit. | `./gemini-cli --add-key` |
| `--remove-key <index>` | | Remove an API key from the configuration file and exit. | `./gemini-cli --remove-key 1` |
| `--check-keys` | | Validate all configured API keys and exit. | `./gemini-cli --check-keys` |
| `--loc` | | Get location information (requires `--free` mode). | `./gemini-cli -f --loc` |
| `--map` | | Get map URL for location (requires `--free` mode). | `./gemini-cli -f --map` |
### Interactive Mode
To start a conversation, simply run the executable. T
Selected from shared topics, language and repository description—not editorial ratings.
Containerpak /
A fast, decentralized, portable, powerful and low-memory footprint package format for Linux.
59/100 healthNatLabRockies /
LK (Language Kit) is a simple but powerful scripting language that is designed to be small, fast, and easily embedded in other applications. The core LK engine, including lexical analyzer, parser, compiler, and virtual machine is only dependent on the Standard C++ Library (STL), making it extremely lightweight and portable.
74/100 healthTomcc /
A simple, portable and somewhat powerful C++ game engine
43/100 health/paste)./save), a Markdown file (/export), and import it later (/load)./system).GEMINI_API_KEY, GEMINI_API_KEY_ORIGIN).Origin header via environment variable or config file, a crucial feature for using API keys secured by HTTP referrers.config.json) for persistence of model, temperature, seed, API key, and other settings.-c flag./config save./stats command./models command.topK, topP, and other parameters, both at startup and interactively during a session.createsoftware /
Create Synchronicity is an easy, fast and powerful backup application. It synchronizes files & folders, has a neat interface, and can schedule backups to keep your data safe. Plus, it's open source, portable, multilingual, and very light (180kB).
34/100 healthDevBubba /
A lightweight yet powerful batch script that automates temp file cleanup, disk maintenance, and system optimization. Features an interactive menu, admin privilege handling, and fast execution. Portable & efficient!
52/100 healthOldLiu001 /
A powerful, portable library for VBScript & JScript to control Windows Terminal. Include color output, cursor control, and so on.
34/100 health