groq-chat is a minimalistic, high-performance command-line interface (CLI) for interacting with Groq AI and other OpenAI compartible models. Written in Go, it provides a fast, resource-efficient one-shot chat experience ideal for developers and AI enthusiasts.
- Tiny Memory usage: 11β14MB
- Small Docker image size: ~9β11MB
- Cross-platform: Windows, Linux, macOS
- One-shot prompts only β no conversation context is preserved.
- Fast & lightweight β runs even on older hardware.
- Interactive CLI β switch models, view history, and more.
- Response statistics β see token count, completion time, and tokens per second.
- Support for multiple AI providers β works with any OpenAI-compatible API.
- Groq API Key: Sign up here
- (Optional) OpenAI API Key if you want to use OpenAI models, also you can get xAI, OpenRouter, Mistral, etc.
- (Optional) Go 1.18+ if building from source
- (Optional) Docker for containerized usage
- Visit Releases
- Download your platform-specific archive
- Extract and move the binary into your
$PATHtar -xzf groq-chat-linux-amd64.tar.gz mv groq-chat /usr/local/bin/
- Pull the latest image
docker pull oleksiyml/groq-chat- Provide GROQ_API_KEY as an value
docker run --rm -it \
-e GROQ_API_KEY=your_api_key \
-v $HOME/.groq-chat:/root/.groq-chat \
oleksiyml/groq-chat- Provide GROQ_API_KEY as an env variable
export GROQ_API_KEY=your_api_key
docker run --rm -it \
-e GROQ_API_KEY=$GROQ_API_KEY \
-v $HOME/.groq-chat:/root/.groq-chat \
oleksiyml/groq-chatSee details at Docker hub.
groq-chatAfter that you will see:
π One-shot Groq CLI chat
[i]nfo | [m]odel | [u]pdate | [h]istory ([s]ave:%s) | [c]onfig | [q]uit
[model_name] >The %s placeholder allows for dynamic display of the history saving status (On/Off).
[i]β Show current model info[m]β Switch model (up to 20 shown)[u]β Update models list from the current provider. Excluded models (part of the names) can be configured inconfig_<provider>.yaml(see below)[h]β Show history - list of the saved answers in Markdown format[s]β Toggle history saving (On/Off)[c]β Change config (it should be previously saved inconfig_<provider>.yaml)[q]β Quit
Examples of good one-shot prompts
Example 1:
You are a DevOps engineer. Explain the best practices for setting up a CI/CD pipeline using Jenkins in 200-300 words.
Example 2:
You are a Linux system administrator. Summarize the key steps to secure a Linux server against common vulnerabilities in 200-300 words.
Example 3:
You are a cloud engineer. Describe the process of deploying a containerized application on Kubernetes, including key commands, in 200-300 words.
Example 4:
You are a network engineer. Summarize how to configure a firewall using `iptables` to allow HTTP and SSH traffic in 200-300 words.
Example 5:
You are a DevOps specialist. Explain how to monitor system performance using `top`, `htop`, and `vmstat` commands in 200-300 words.
Example 6:
You are a Linux user. Summarize how to use `grep` and `awk` together to extract and process log file data in 200-300 words.
Example 7:
You are a system administrator. Describe the steps to automate backups using `rsync` and cron jobs in 200-300 words.
Remember: Each prompt must be fully self-contained.
After receiving a response, you'll see statistics in the format:
ββββ€ Stats: 31 tokens | 0.02 sec | 1911.78 tok/sec ββββ
This shows:
- Total tokens used
- Completion time in seconds
- Tokens per second processing rate
~/.groq-chat/config.yaml
api_key_name: GROQ_API_KEY
app_title: "\U0001F34E One-shot Groq CLI chat"
base_url: https://api.groq.com/openai/v1
default_model: allam-2-7b
excluded_models:
- whisper
- playai
models:
- allam-2-7b
- compound-beta
- compound-beta-mini
- deepseek-r1-distill-llama-70b
- gemma2-9b-it
- llama-3.1-8b-instant
- llama-3.3-70b-versatile
- llama3-70b-8192
- llama3-8b-8192
- meta-llama/llama-4-maverick-17b-128e-instruct
- meta-llama/llama-4-scout-17b-16e-instruct
- meta-llama/llama-guard-4-12b
- meta-llama/llama-prompt-guard-2-22m
- meta-llama/llama-prompt-guard-2-86m
- mistral-saba-24b
- qwen-qwq-32b
- qwen/qwen3-32b
provider_name: Groq
save_history: false- Use
GROQ_API_KEYas env variable. - You canchange any of the values.
- Models list will be updated automatically via
[u]command. - You can exclude some models from the list when updating. Each line is part of the excluded model(s) name
- You can create your own config file and use it with
[c]command. (see below)
Note: You can save all your API keys in the
~/.zshrcor~/.bashrcfile.export GROQ_API_KEY=your_api_key export OPENAI_API_KEY=your_api_key export OPENROUTER_API_KEY=your_api_key export XAI_API_KEY=your_api_keyafter that run
source ~/.zshrcor
source ~/bashrcto apply changes.
Examples of config files
config_grok.yaml
api_key_name: XAI_API_KEY
app_title: "\U0001F680 One-shot Grok-3 CLI chat"
base_url: https://api.x.ai/v1
default_model: grok-3-mini
excluded_models:
- fast
- playai
models:
- grok-3
- grok-3-mini
provider_name: Grok
save_history: falseconfig_openai.yaml
api_key_name: OPENAI_API_KEY
app_title: "One-shot OpenAI CLI chat"
base_url: https://api.openai.com
default_model: gpt-4.1-mini
excluded_models:
- fast
- 3.5
models:
- gpt-4.1-mini
- gpt-4.1
provider_name: OpenAI
save_history: falseconfig_openrouter.yaml
api_key_name: OPENROUTER_API_KEY
app_title: "One-shot OpenRouter CLI chat"
base_url: https://openrouter.ai/api/v1
default_model: nvidia/llama-3.3-nemotron-super-49b-v1:free
excluded_models:
- fast
- -3.1
models:
- deepseek/deepseek-chat-v3-0324:free
- deepseek/deepseek-v3-base:free
- deepseek/deepseek-r1:free
- nvidia/llama-3.1-nemotron-ultra-253b-v1:free
- nvidia/llama-3.3-nemotron-super-49b-v1:free
- qwen/qwen3-235b-a22b:free
provider_name: OpenRouter
save_history: false- Use
api_key_nameas env variable.
- The chat history is saved as Markdown files in
~/.groq-chat/history/. Each chat is a separate file, named after the timestamp of the chat creation. - It can be viewed in any Markdown viewer,
nanorecommended. - You can delete them manually
git clone https://github.com/OleksiyM/groq-cli-chat
cd groq-cli-chat
make buildOutput will be in bin/groq-chat
Optional:
make build # Build the binary
make clean # Clean build artifacts
make release # Build .zip/.tar.gz archives and binaries
make docker # Docker image (Debian base) - not implemented yetcmd/
βββ main.go/ # Main CLI entry point
internal/
βββ chat/ # Chat loop, history
βββ config/ # Config management
βββ groq/ # API client
resources/ # UI messages, defaults
Dockerfile # distroless Debian image (~9MB)
Dockerfile.rhel # scratch-based RHEL image
bin/ # Compiled binaries
go.mod # Go module file
go.sum # Go module checksum file
Makefile # Build automation
README.md # This file
- Minimal memory & disk usage
- Clean, interactive CLI
- Configurable via YAML and env vars
- Secure (no API key in source)
- Chat history in Markdown (optional, configured in the
settings.yaml) - Blasing fast
- Crossplatform (Linux, macOS, Windows)
- Response statistics (tokens, time, tokens/sec)
- Support for multiple AI providers (OpenAI compartible APIs)
- Create a CLI interface in Go with an interactive shell
- Save chat history as Markdown files
- Support model selection from a list (up to 10 for now)
- Built-in model information viewer
- Cross-platform releases (
.tar.gz,.zip) forLinux,macOS, andWindows - Compact Docker images based on Debian and RHEL
- Configuration via
YAMLandGROQ_API_KEYenvironment variable - GitHub Actions: automatic build and release publishing
- Response statistics (tokens, time, tokens/sec)
- Support for multiple AI providers (OpenAI-compatible APIs)
- Add toggle for save history to
settings.yaml - Add menu command for tooggle save history
- CI: add unit tests and run go test in GitHub Actions
- Multi-turn chat support
- ANSI color output
- Expand CLI functionality: --config flag, auto-loading models
- Generate simple HTML version of chat history (from .md files)
- CLI command autocompletion for [i], [m], [h], etc., in TUI
- Documentation: add demos (GIFs/SVGs), example prompts
- Publish Docker images to Docker Hub (automatically from CI)
- Separate internal API and UI (prep for SDK/library)
Contributions, ideas, and bug reports are welcome. Stay tuned for issue templates and guidelines.
Made with β€οΈ for hackers, devs, DevOps, SysAdmins and prompt-crafters.