Ch

Lightweight AI CLI Tool

Vision

Ch is a lightweight, fast, and powerful CLI tool for terminal-based AI interactions with full user control. As the successor to Cha, it provides direct terminal access to powerful AI models with minimal overhead, transparent operations, and explicit user control. It integrates seamlessly into developer environments, minimizing context switching and empowering users to leverage AI's full potential through flexible, user-driven interactions without automated decisions or hidden costs.

Installation

curl -fsSL https://raw.githubusercontent.com/MehmetMHY/ch/main/install.sh | bash

Preview

$ ch "Explain goroutines in Go in 4 bullets"
Goroutines are lightweight functions scheduled by the Go runtime, not one OS thread each.
- start one with go f() and keep the caller moving
- communicate with channels when ownership should move between tasks
- use sync.WaitGroup or context.Context so work has a clean lifecycle
- prefer small, boring goroutines over hidden global background work

$ git diff | ch "summarize the risky changes"
Risk summary:
- config parsing now treats explicit false correctly
- export paths sanitize slashes but preserve spaces and dots
- add one regression test for quoted filenames and one for empty custom names

$ ch -l README.md "turn install steps into a checklist"
Checklist:
1. install with curl | bash
2. set OPENAI_API_KEY or switch providers
3. run ch -v to verify version metadata
4. try a direct prompt, then interactive mode

$ ch -s https://youtube.com/watch?v=AH0xG1iStf4
YouTube: Ch demo
metadata loaded, subtitles compacted, cue numbers stripped
ready to paste into a prompt or pipe into another command

$ ch -w "Go 1.26 release notes"
1. Go release notes - https://go.dev/doc/devel/release
2. Go blog - https://go.dev/blog/
3. Standard library changes - https://pkg.go.dev/std

$ ch -y -d ./internal
codedump saved: ch_dump_internal_2026-08-19.txt
included 47 text files, skipped binaries and vendor caches

$ ch -y -b ./cmd cli_context.txt
codedump saved: cli_context.txt
interactive pickers skipped by --yes

$ cat README.md | ch -t
Token estimate for stdin: 14,820 tokens
model: gpt-5.4-mini

$ ch -p groq -m llama3-8b-8192 "give me a fast regex"
groq llama3-8b-8192
Use (?m)^func\s+([A-Za-z0-9_]+)\( to list Go function names line-by-line.

$ ch
interactive session started
openai gpt-5.4-mini

user: !p xai
xai grok-4-fast-non-reasoning
user: !o
google gemini-2.5-flash
user: !p openrouter
openrouter anthropic/claude-3.5-sonnet
user: !r high
reasoning: high
user: !l ./internal/config
loaded 6 files into context
user: What config behavior should tests protect?
Protect env overrides, explicit false booleans, shallow_load_dirs defaults, and provider key mapping.
user: !e config_notes.txt
exported chat: config_notes.txt
user: !z
compressed summary (through turn 5):
Env overrides, explicit false booleans, shallow_load_dirs, provider key mapping, export sanitization.
user: !q
bye

$ ch -c "continue where we left off"
loaded latest session and sent follow-up prompt

$ 

tap a command to copy click cmd to copy · arrow keys or drag to scroll

Demo

Features

Ch brings powerful AI capabilities directly to your terminal:

High Performance
10x faster startup than its predecessor Cha; built natively in Go for maximum efficiency.
Universal Platform Access
Connect to OpenAI, Anthropic, Gemini, Groq, OpenRouter, Mistral, Together, DeepSeek, xAI, Amazon Bedrock, and Ollama with seamless mid-chat switching.
Shell Native Integration
Built for the pipeline. Pipe command outputs directly to Ch, or use your preferred editor (Vim, Helix) for complex prompts.
Deep Context & Search
Load PDFs, Word docs, images (via OCR), or scrape URLs. Includes built-in Brave Search and YouTube analysis.
Advanced Context Gathering
Package entire directories for code analysis, or record terminal outputs from tools like Claude Code or Kiro.
Robust Session Management
Optionally persist sessions, backtrack through history, compress long conversations to save tokens without losing context, and search previous chats instantly using fzf-powered fuzzy matching.
Smart Model Intelligence
Real-time reasoning/thinking display, reasoning effort control with per-model filtering via Models.dev metadata, newest-first model sorting via API timestamps, and support for 22+ Amazon Bedrock regions.
Local-First & Private
Run models locally via Ollama. No API keys required, no data leaves your machine, and total transparency with zero "black box" decisions.
Pro Developer Workflow
Extract specific code blocks with proper extensions, get AI-suggested filenames during exports based on chat context, track token usage with model-aware counting, and copy responses to your cross-platform clipboard.
Security-Conscious Defaults
Uses private local file permissions, validates provider model-list URLs, cancels long-running provider requests explicitly, and ships contributor gates for static analysis, secret scanning, and Go vulnerability checks.

Documentation

For detailed usage and configuration, please refer to the GitHub repository or render the project's README below.

Loading documentation...