GemChat is a fast, lightweight Go CLI for Google's Gemma 4 12B — the latest encoder-free multimodal model. Send text prompts, analyze images, pipe data, and get answers instantly. Single binary, zero dependencies.
# Text chat
gemchat "What is the meaning of life?"
# Multimodal — analyze images
gemchat -i chart.png "Explain this data visualization"
# Pipe data in
tail -100 server.log | gemchat --pipe "Find the errors:"Google just released Gemma 4 12B — a unified, encoder-free multimodal model that processes images natively as tokens rather than using a separate vision encoder. This architectural shift means better understanding of visual context and more coherent multimodal reasoning. And it's free for developers via the Gemini API.
- 🎯 Text generation — any prompt, any task
- 🖼️ Image analysis — PNG, JPG, WebP, GIF, BMP
- 📡 Pipe support —
cat file | gemchat --pipe "summarize:" - 📝 System instructions — set persona/context with
-s - 🌡️ Configurable — temperature, max tokens, model selection
- 🎨 Clean output — plain text by default, JSON with
-json - ⚡ Single binary — no Python, no Node, no runtime deps
# Linux x86_64
curl -sL https://github.com/onurege3467/gemchat/releases/latest/download/gemchat-linux-amd64 -o /usr/local/bin/gemchat
chmod +x /usr/local/bin/gemchatgit clone https://github.com/onurege3467/gemchat.git
cd gemchat
go build -o gemchat .
sudo mv gemchat /usr/local/bin/Option 3: Use the LLM agent prompt (see INSTALL.md)
Get a free key from Google AI Studio.
# Option A: environment variable
export GEMINI_API_KEY="your-key-here"
# Option B: config file (persistent)
mkdir -p ~/.gemini
echo "your-key-here" > ~/.gemini/api-key
chmod 600 ~/.gemini/api-key# Basic chat
gemchat "Explain quantum entanglement like I'm 10"
# With system instruction
gemchat -s "You are a helpful Python tutor" "Explain decorators"
# Multimodal
gemchat -i screenshot.png "What error is shown in this screenshot?"
# Pipe mode
curl -s https://news.ycombinator.com | gemchat -s "You are a tech analyst" --pipe "Summarize the top stories on this page"
# Raw JSON output
gemchat -json "List 3 colors" | jq '.candidates[0].content.parts[0].text'# Instruction-tuned variant (default for chat)
gemchat -m gemma-4-12b-it "Write a poem"
# Base model (for completion tasks)
gemchat -m gemma-4-12b "Continue this code:\n\nfunc main() {"# Precise (default 0.7)
gemchat -t 0.2 "What is 2+2?"
# Creative
gemchat -t 1.5 "Write a haiku about programming"# Longer responses
gemchat -max-tokens 16384 "Explain the history of computing in detail"Use GemChat in GitHub Actions for AI-powered analysis:
name: AI Review
on: [pull_request]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install GemChat
run: |
curl -sL https://github.com/onurege3467/gemchat/releases/latest/download/gemchat-linux-amd64 -o /usr/local/bin/gemchat
chmod +x /usr/local/bin/gemchat
- name: Review code
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: |
gemchat -s "You are a code reviewer. Be concise." "Review this PR diff: $(git diff main...HEAD)"GemChat calls the Google Gemini API under the hood, targeting the gemma-4-12b or gemma-4-12b-it model. The model is encoder-free — it processes images as raw token sequences without a separate vision encoder, giving it more coherent multimodal understanding.
| Flag | Default | Description |
|---|---|---|
-m |
gemma-4-12b |
Model name |
-i |
"" |
Image path (PNG, JPG, WebP, GIF, BMP) |
-s |
"" |
System instruction |
-t |
0.7 |
Temperature (0.0–2.0) |
-max-tokens |
8192 |
Max output tokens |
-pipe |
false |
Read prompt from stdin pipe |
-json |
false |
Output raw JSON |
Active. Gemma 4 12B is brand new (June 2026) — expect rapid iterations.
PRs welcome! See CONTRIBUTING.md. Small, focused changes preferred.
MIT — see LICENSE.