Prerequisites
Git Required to clone the repository and for Go to download dependencies.
Go 1.25+ Only needed for go install or building from source.
API Key or OAuth An API key from an LLM provider or an account with an active plan for OAuth.
1. Installation
Binary (Recommended)
go install
From Source
Docker
The easiest way. Download the binary for your system directly from the Releases page . # Linux/macOS — adjust the filename according to the release
chmod +x chatcli
sudo mv chatcli /usr/local/bin/
Available for Linux , macOS , and Windows on amd64 and arm64 architectures.
If you have Go installed: go install github.com/diillson/chatcli@latest
The binary will be installed in $GOPATH/bin. Make sure it is in your PATH: export PATH = $PATH :$( go env GOPATH )/ bin
Add the line above to your .bashrc or .zshrc to persist across sessions. For those who want to compile locally or contribute:
Clone the repository
git clone https://github.com/diillson/chatcli.git
cd chatcli
Build
go mod tidy
go build -o chatcli
(Optional) Build with version information
VERSION = $( git describe --tags --always --dirty 2> /dev/null || echo "dev" )
COMMIT_HASH = $( git rev-parse --short HEAD )
BUILD_DATE = $( date -u +"%Y-%m-%dT%H:%M:%SZ" )
go build -ldflags " \
-X github.com/diillson/chatcli/version.Version=${ VERSION } \
-X github.com/diillson/chatcli/version.CommitHash=${ COMMIT_HASH } \
-X github.com/diillson/chatcli/version.BuildDate=${ BUILD_DATE }" \
-o chatcli main.go
This injects version data into the binary, accessible via /version or chatcli --version.
Move to PATH
sudo mv chatcli /usr/local/bin/
Create a .env file in your home directory or in the project root.
OpenAI
Anthropic (Claude)
Google (Gemini)
xAI (Grok)
Ollama (Local)
OAuth (no API key)
LLM_PROVIDER=OPENAI
OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# (Optional) Specific model — default: gpt-4o-mini
# OPENAI_MODEL="gpt-4o"
LLM_PROVIDER=CLAUDEAI
ANTHROPIC_API_KEY="sk-ant-xxxxxxxxxxxxxxxxxxxxxxxx"
# (Optional) Model — default: claude-sonnet-4-5
# ANTHROPIC_MODEL="claude-sonnet-4-20250514"
LLM_PROVIDER=GOOGLEAI
GOOGLEAI_API_KEY="AIzaxxxxxxxxxxxxxxxxxxxxxxxx"
# (Optional) Model — default: gemini-2.5-flash
# GOOGLEAI_MODEL="gemini-2.5-flash"
LLM_PROVIDER=XAI
XAI_API_KEY="xai-xxxxxxxxxxxxxxxxxxxxxxxx"
# (Optional) Model — default: grok-4-latest
# XAI_MODEL="grok-4-latest"
LLM_PROVIDER=OLLAMA
OLLAMA_ENABLED=true
OLLAMA_BASE_URL="http://localhost:11434"
OLLAMA_MODEL="llama3"
No API key required. Install Ollama from ollama.com and download a model with ollama pull llama3. If you have ChatGPT Plus/Codex , Claude Pro , or GitHub Copilot : chatcli
# Inside interactive mode:
/auth login openai-codex # OpenAI (PKCE OAuth)
/auth login anthropic # Anthropic (PKCE OAuth)
/auth login github-copilot # GitHub Copilot (Device Flow)
The browser will open automatically. See the OAuth documentation for details.
You only need to configure the providers you plan to use. ChatCLI automatically detects which ones are available based on the keys found.
Additional Environment Variables
Variable Description Default CHATCLI_DOTENVCustom path for the .env file .envCHATCLI_LANGForce a specific language (e.g., pt-BR, en) Auto-detected LOG_LEVELLog level: debug, info, warn, error infoENVLog mode: dev (terminal + file), prod (file only) devMAX_RETRIESMaximum retries for API calls 5
For the complete list of variables, see the Environment Variables Reference .
3. Verify the Installation
Check the active configuration
chatcli
# Inside interactive mode:
/config
Ask your first question
What is the Dirac equation?
If you get a response from the AI, congratulations! ChatCLI is ready to use.
Next Steps