Unified AI platform for terminal, gRPC server, and Kubernetes.
14 providers · 14 autonomous agents · 7-pattern quality pipeline · one binary.
Português • Full documentation • Architecture • Observability

ChatCLI connects the industry's leading LLMs to a single, extensible interface — from
chatcli -pin your terminal to a Kubernetes operator with an autonomous AIOps pipeline, passing through a production-ready gRPC server with authentication, failover, and Prometheus metrics.
| Multi-provider with failover | 14 LLM providers (OpenAI · OpenAI Responses · Anthropic · Bedrock · Google · xAI · ZAI · MiniMax · Moonshot (Kimi) · Copilot · GitHub Models · StackSpot · OpenRouter · Ollama) with intelligent error classification, exponential backoff, and per-provider cooldown. |
| Autonomous agents | 14 built-in workers coordinated by a ReAct engine (Reason + Act): 12 orchestration specialists run in parallel + 2 quality agents (refiner, verifier), plus a 7-pattern quality pipeline. |
| Quality pipeline | Self-Refine, Chain-of-Verification (CoVe), Reflexion, RAG + HyDE, Plan-and-Solve (ReWOO), cross-provider reasoning backbone — all composed via a thread-safe state machine with circuit breakers and hot reload. |
| Scheduler (Chronos) | Durable scheduling with cron + wait-until + DAG + daemon mode. /schedule, /wait, /jobs + @scheduler tool for agents. CRC32 WAL, snapshots, rate limiter, circuit breakers, JSONL audit, 13 Prometheus metrics. Jobs survive crashes and CLI exit. |
| Durable Reflexion | WAL-backed queue with worker pool, dead letter queue, boot replay, exponential retry with jitter — lessons survive process crashes. |
| Semantic convergence | char → Jaccard → embedding cosine cascade for Self-Refine, with LRU/TTL cache and quality regression detection. |
| Production-ready | gRPC + TLS 1.3, JWT + RBAC, AES-256-GCM, rate limiting, audit logging, 50+ Prometheus metrics. |
| Kubernetes-native | Operator with 17 CRDs and an autonomous AIOps pipeline (54+ remediation actions), SLO monitoring, post-mortems. |
| Extensible | Plugins with Ed25519 signature verification, multi-registry skills (skills.sh, ClawHub, ChatCLI.dev), lifecycle hooks, MCP client (stdio + SSE). |
# Homebrew (macOS / Linux)
brew tap diillson/chatcli && brew install chatcli
# Go install
go install github.com/diillson/chatcli@latest
# Pre-built, cosign-signed binaries
# https://github.com/diillson/chatcli/releases
Build from source
git clone https://github.com/diillson/chatcli.git && cd chatcli
go mod tidy && go build -o chatcli
# With version metadata injected via ldflags
VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "dev")
go build -ldflags "-X github.com/diillson/chatcli/version.Version=${VERSION}" -o chatcli
LLM_PROVIDER=OPENAI # OPENAI, CLAUDEAI, BEDROCK, GOOGLEAI, XAI, ZAI, MINIMAX, MOONSHOT,
# COPILOT, GITHUB_MODELS, OLLAMA, STACKSPOT, OPENROUTER
OPENAI_API_KEY=sk-xxx
Full provider configuration reference
| Provider | API Key | Model | Extras |
|---|---|---|---|
| OpenAI | OPENAI_API_KEY |
OPENAI_MODEL |
OPENAI_MAX_TOKENS, OPENAI_USE_RESPONSES |
| Anthropic | ANTHROPIC_API_KEY |
ANTHROPIC_MODEL |
ANTHROPIC_MAX_TOKENS |
| AWS Bedrock | IAM / Profile / credentials chain | BEDROCK_MODEL |
AWS_REGION, BEDROCK_CROSS_REGION |
| Google Gemini | GOOGLEAI_API_KEY |
GOOGLEAI_MODEL |
GOOGLEAI_MAX_TOKENS |
| xAI | XAI_API_KEY |
XAI_MODEL |
XAI_MAX_TOKENS |
| ZAI | ZAI_API_KEY |
ZAI_MODEL |
ZAI_MAX_TOKENS |
| MiniMax | MINIMAX_API_KEY |
MINIMAX_MODEL |
MINIMAX_MAX_TOKENS |
| Moonshot (Kimi) | MOONSHOT_API_KEY |
MOONSHOT_MODEL |
MOONSHOT_MAX_TOKENS, MOONSHOT_THINKING |
| GitHub Copilot | GITHUB_COPILOT_TOKEN |
COPILOT_MODEL |
or /auth login github-copilot |
| GitHub Models | GITHUB_TOKEN |
GITHUB_MODELS_MODEL |
GH_TOKEN, GITHUB_MODELS_TOKEN |
| StackSpot | CLIENT_ID, CLIENT_KEY |
— | STACKSPOT_REALM, STACKSPOT_AGENT_ID |
| OpenRouter | OPENROUTER_API_KEY |
— | OPENROUTER_MAX_TOKENS, OPENROUTER_FALLBACK_MODELS |
| Ollama | — | OLLAMA_MODEL |
OLLAMA_ENABLED=true, OLLAMA_BASE_URL |
| OpenAI (Responses API) | OPENAI_API_KEY |
OPENAI_MODEL |
OPENAI_RESPONSES_API_URL |
### Interactive CLI
AI-powered terminal with a Bubble Tea TUI, project context, tool calling, and autonomous agents.
|
### gRPC Server
Shared backend with TLS 1.3, JWT/RBAC, failover, Prometheus metrics, MCP, and plugin discovery.
|
### Kubernetes Operator
Autonomous AIOps pipeline with 17 CRDs, 54+ remediation actions, SLO monitoring, and post-mortems.
|
The scheduler runs embedded in the CLI and optionally as a daemon. Jobs survive restarts via WAL + snapshot.
# Fire a command in 30s
/schedule ping --when +30s --do "/run curl https://api.example.com/health"
# Daily cron with retry
/schedule backup --cron "0 2 * * *" --do "shell: ./backup.sh" --max-retries 3
# Deploy + K8s wait + trigger smoke
/schedule deploy --when +0s --do "shell: terraform apply -auto-approve" \
--wait "k8s:deployment/prod/api:Available" --timeout 15m \
--triggers smoke-tests
# Daemon to keep running with the CLI closed
chatcli daemon start --detach
chatcli daemon status
# List / inspect / cancel
/jobs list
/jobs show <id>
/jobs tree
/jobs cancel <id>
Agents get the @scheduler tool and can pause themselves waiting on conditions — see Cookbook: scheduler automation and the feature doc.
Context commands (CLI mode)
Inject environment data directly into your prompt:
| Command | Description |
|---|---|
@git |
Status, branches, and recent commits |
@file <path> |
File or directory contents |
@env |
Environment variables |
@history |
Recent shell commands |
@command <cmd> |
Execute a command and inject its output |
Kubernetes manifest example (Instance CRD)
apiVersion: platform.chatcli.io/v1alpha1
kind: Instance
metadata:
name: chatcli-prod
spec:
provider: ZAI
model: glm-5
replicas: 2
fallback:
enabled: true
providers:
- name: OPENAI
model: gpt-5.4
- name: MINIMAX
model: MiniMax-M2.7
helm install chatcli oci://ghcr.io/diillson/charts/chatcli \
--namespace chatcli --create-namespace \
--set llm.provider=OPENAI --set secrets.openaiApiKey=sk-xxx
14 providers with a unified interface. Automatic failover with intelligent error classification, cross-provider extended thinking, and prompt caching where available.
| Provider | Default Model | Tool Calling | Vision | Reasoning / Thinking |
|---|---|---|---|---|
| OpenAI | gpt-5.4 | Native | Yes | reasoning_effort (o-series / gpt-5) |
| Anthropic (Claude) | claude-sonnet-4-6 | Native | Yes | Extended thinking with cache |
| AWS Bedrock | claude-sonnet-4-5 | Native | Yes | Thinking budget (Anthropic models) |
| Google Gemini | gemini-2.5-flash | Native | Yes | — |
| xAI (Grok) | grok-4-1 | XML fallback | — | — |
| ZAI (Zhipu AI) | glm-5 | Native | Yes | — |
| MiniMax | MiniMax-M2.7 | Native | Yes | — |
| Moonshot (Kimi) | kimi-k2.6 | Native | Yes | MOONSHOT_THINKING=enabled\|disabled\|auto |
| GitHub Copilot | gpt-4o | Native | Yes | — |
| GitHub Models | gpt-4o | Native | Yes | — |
| StackSpot AI | StackSpotAI | — | — | — |
| OpenRouter | openai/gpt-5.2 | Native | Yes | Passthrough |
| Ollama | (local) | XML fallback | — | <thinking> tag normalization |
| OpenAI (Responses API) | gpt-5.4 | Native | Yes | reasoning_effort |
# Configurable fallback chain
CHATCLI_FALLBACK_PROVIDERS=OPENAI,CLAUDEAI,BEDROCK,ZAI,MINIMAX,MOONSHOT,OPENROUTER
/thinking on|off|auto enables extended thinking / reasoning_effort on any provider that supports it — the cross-provider mapping is automatic.
ReAct engine (Reason + Act) with 14 built-in agents: 12 orchestration specialists running in parallel (
file, coder, shell, git, search, planner, reviewer, tester, refactor, diagnostics, formatter, deps) + 2 quality-harness agents (refiner,verifier).
/coder "Refactor the auth module to use JWT"
chatcli -p "Create tests for the utils package" --agent-auto-exec
| Agent | Responsibility |
|---|---|
| File | File reading, writing, and manipulation |
| Coder | Code generation and editing |
| Shell | System command execution |
| Git | Version control operations |
| Search | Code and file search |
| Planner | Complex task decomposition (Plan-and-Solve / ReWOO) |
| Reviewer | Automated code review |
| Tester | Test generation and execution |
| Refactor | Safe code refactoring |
| Diagnostics | Problem analysis and debugging |
| Formatter | Formatting and linting |
| Deps | Dependency management |
| Refiner | Self-Refine post-hook (critique → revise) |
| Verifier | Chain-of-Verification (questions + final answer) |
Workers are coordinated by the dispatcher with a configurable semaphore (CHATCLI_AGENT_MAX_WORKERS), retry policy, and FileLockManager synchronization.
Seven prompting/execution patterns composed via a pluggable pipeline with state machine, hot reload, and per-hook isolation.
| # | Pattern | Status | Opt-in |
|---|---|---|---|
| 1 | ReAct (Reason + Act) | ✅ agent core | — |
| 2 | Plan-and-Solve / ReWOO | ✅ | /plan, CHATCLI_QUALITY_PLAN_FIRST_MODE |
| 3 | Reflexion (with durable queue) | ✅ | on by default |
| 4 | RAG + HyDE | ✅ | CHATCLI_QUALITY_HYDE_ENABLED=1 |
| 5 | Self-Refine (with semantic convergence) | ✅ | CHATCLI_QUALITY_REFINE_ENABLED=1 |
| 6 | Chain-of-Verification (CoVe) | ✅ | CHATCLI_QUALITY_VERIFY_ENABLED=1 |
| 7 | Cross-provider reasoning backbone | ✅ | CHATCLI_QUALITY_REASONING_MODE=auto |
atomic.Pointer[snapshot] — AddPre/AddPost/SwapConfig are atomic, zero locks on the hot path.Prioritized interface (backward-compatible — unmarked hooks default to 100).ErrSkipExecution (cache-hit before agent.Execute) and ErrSkipRemainingHooks (ensemble patterns).$ claude mcp add chatcli \
-- python -m otcore.mcp_server <graph>