Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
Deprecated AI CLI for terminal based interactions. Replaced by Ch, its actively developed successor.
Jump to setup instructionsFetched from the repository for this visit.
As of August 23, 2025, Cha is no longer maintained. Its actively developed successor is Ch, a faster, lightweight Go implementation offering the same core functionality. This repository remains as a historical reference and will receive no further updates. Please migrate to Ch for continued support, new features, and improvements. To migrate your Cha chat history to Ch, use this migration script.
Cha is a comprehensive open-source command-line tool that provides advanced interactions with AI models from multiple providers including OpenAI, Anthropic, Groq, DeepSeek, Ollama, and more. It delivers a feature-rich experience for engaging with powerful language models directly from your terminal, offering sophisticated capabilities like platform switching mid-conversation, voice recording and playback, web scraping, file processing, and extensive chat history management. For users seeking a more lightweight solution, ch provides a fast GoLang implementation of Cha's core functionality with essential features optimized for speed and minimal resource usage.
Cha is a powerful, feature-rich CLI tool that provides direct terminal access to advanced AI capabilities. While maintaining core principles of user control and transparency, Cha offers comprehensive functionality for professional workflows including voice processing, web integration, file manipulation, and sophisticated chat management. It integrates seamlessly into developer environments, minimizing context switching and empowering users to leverage AI's full potential through explicit control and flexible, user-driven interactions without automated decisions or hidden costs.
Install:
curl -sSL https://raw.githubusercontent.com/MehmetMHY/cha/main/install.sh | bash
Configure:
# set your openai api key or use ollama (https://ollama.com/) for local models
export OPENAI_API_KEY="your-api-key-here"
Start chatting:
cha "What are the main features of the Rust programming language?"
For detailed installation options and configuration, see Getting Started.
cha command.\ to toggle multi-line mode, then \ again to send.TEXT_TO_SPEECH_MODEL = "local" in config). Use !r in interactive mode or cha -r from command line.!o in interactive mode or cha --voice from command line.!s) and deep answer search (!w) similar to Perplexity's solution.--platform argument.!m.!p, maintaining full chat history.!s (quick search) or !w (deep answer search).!x (interactive shell) or !x <command> (run specific commands), enhancing workflow efficiency by providing immediate terminal access.fzf for Selection: Use fzf for interactive selection when searching chat history, traversing local files, or using the codedump feature.!l) for quick selection in current directory, and advanced mode (!f) with full directory traversal, direct path support (cd dirname, cd ..), clean interface, and efficient file selection using fzf.!n. Supports direct path navigation (!n /path/to/directory) or interactive fzf-based navigation starting from your home directory. Track directory history and select final destination from visited directories.!v. Select files, make AI-powered edits, view diffs, and access a shell for testing. Inside the editor, use help or h to see a full list of commands, including diff (d), save (s), undo (u), running shell commands (!x), and using your terminal editor for long prompts (!t).!e with interactive fzf selection. Choose from individual chats, all chats as text, or complete history as JSON. The interface shows chat previews sorted by newest to oldest, with [ALL] and [ALL JSON] options for bulk exports.!y. Select responses with fzf, edit them in your terminal editor, and the final content is copied for easy pasting.!..Cha relies on several external command-line tools for optimal functionality. The installation script handles most of these automatically.
| Tool | Purpose | Installation |
|---|---|---|
fzf | Interactive selection (history, files, navigation) | brew install fzf (macOS)apt install fzf (Ubuntu) |
ripgrep (rg) | History search functionality | brew install ripgrep (macOS)apt install ripgrep (Ubuntu) |
bat | Syntax-highlighted previews | brew install bat (macOS)apt install bat (Ubuntu) |
netcat (nc) | Network connectivity checks | Usually pre-installed |
ffmpeg | Voice recording, media processing, and yt-dlp | brew install ffmpeg (macOS)apt install ffmpeg (Ubuntu) |
macOS (Homebrew):
brew install fzf ripgrep bat ffmpeg
Ubuntu/Debian:
sudo apt update && sudo apt install fzf ripgrep bat ffmpeg netcat-openbsd
Arch Linux:
sudo pacman -S fzf ripgrep bat ffmpeg openbsd-netcat
Note: The
install.shscript automatically detects and installs missing dependencies on supported systems.
The most reliable way to get up and running is with our one-command installer. It provides a clean, self-contained installation that won't interfere with other Python projects or system packages.
Open your terminal and run the following command:
curl -sSL https://raw.githubusercontent.com/MehmetMHY/cha/main/install.sh | bash
The script automates the entire setup process, including checking for dependencies, creating a dedicated environment, and making the cha command accessible system-wide. To update, simply run the command again.
If you prefer to clone the repository manually, you can still use the installation script. This is also a good option if you want to contribute to development.
git clone https://github.com/MehmetMHY/cha.git
cd cha
./install.sh
Running the script from the cloned repository will automatically pull the latest changes and update your installation.
If you prefer a different approach, the following options are available. Note that with these methods, you are responsible for managing dependencies and the Python environment.
If you have Python installed, you can install Cha via pip, which should be available by default:
pip install git+https://github.com/MehmetMHY/cha.git
To install using pipx, first make sure you have pipx installed, then run:
pipx install 'git+https://github.com/MehmetMHY/cha.git'
If you prefer using uv, ensure it is installed from uv installation guide. Then, execute:
uv pip install "git+https://github.com/MehmetMHY/cha.git"
git clone https://github.com/MehmetMHY/cha.git
cd cha
pip3 install --upgrade .
ffmpeg, fzf, ripgrep, and bat installed. You can find installation instructions in the Dependencies section.To update cha to the latest version, simply run the installation command again:
curl -sSL https://raw.githubusercontent.com/MehmetMHY/cha/main/install.sh | bash
The script will detect your existing installation and prompt you to either:
If you installed manually from a git clone, you can update by running the script from within your local repository directory:
# cd /path/to/your/cha-repository
./install.sh
The process is straightforward. Just remove the installation directory and the symbolic link.
rm -rf "$HOME/.cha"
# for some setups, you may need to run the next command with sudo
rm /usr/local/bin/cha
pip install --upgrade git+https://github.com/MehmetMHY/cha.gitpipx upgrade chauv pip install --upgrade "git+https://github.com/MehmetMHY/cha.git"pip uninstall chapipx uninstall chauv pip uninstall chaCha requires an OpenAI API key at minimum. You can obtain one from the OpenAI Platform.
Create a .env file in your project directory or set environment variables directly:
# required openai api key
export OPENAI_API_KEY="sk-your-openai-api-key-here"
# optional additional platform keys
export ANTHROPIC_API_KEY="your-anthropic-key"
export GROQ_API_KEY="your-groq-key"
export DEEPSEEK_API_KEY="your-deepseek-key"
export TOGETHER_API_KEY="your-together-ai-key"
export GEMINI_API_KEY="your-gemini-key"
export XAI_API_KEY="your-xai-key"
Option A: Source the .env file
source .env
Option B: Add to your shell profile
# add to ~/.bashrc, ~/.zshrc, or ~/.profile
echo 'export OPENAI_API_KEY="your-key-here"' >> ~/.zshrc
source ~/.zshrc
The install.sh script will offer to run a verification check after installation. For manual installations, you can run the checkup script from the cloned directory to ensure your environment and API keys are configured correctly. Running the checkup is highly recommended, especially for new users, as it's a great way to debug your setup.
python3 ./assets/dev_tools/checkup.py
Note: Optional checkups can be ignored as they're not required for core functionality.
Once your setup is configured and verified, you can start using Cha:
cha
Refer to the Usage section below for detailed instructions and examples.
chacha "<some question or request>"cha "in type script how can I check if .canvas.edges is an empty array?"
The codedump feature allows you to package your codebase or specific files/directories into a single text file for AI analysis or documentation purposes. It supports multiple modes for maximum flexibility.
cha --codedump or cha -d - Interactive mode (exclude/include selection using fzf)cha --codedump=all or cha -d all - Include everything automatically (respects .gitignore)cha --codedump=stdout or cha -d stdout - Print output to stdout instead of saving to filecha --codedump=all,stdout or cha -d all,stdout - Include everything and print to stdoutcha --codedump=compress or cha -d compress - Interactive mode with content compressionThe codedump feature supports specifying exactly which files and directories to include, perfect for developers who need precise control over what gets packaged.
Basic Specific Includes:
# include specific files
cha -d "include:src/main.py,config.py"
# include entire directories
cha -d "include:src/,tests/"
# mix files and directories
cha -d "include:src/core.py,tests/,docs/README.md"
Advanced Patterns:
# include with glob patterns
cha -d "include:src/**/*.py,*.md"
# include all javascript and typescript files
cha -d "include:*.js,*.ts,src/**/*.jsx"
# include specific subdirectories
cha -d "include:src/components/,src/utils/,tests/unit/"
Combining with Output Options:
# include specific files and output to stdout
cha -d "include:src/main.py,config.py,stdout"
# include directory with stdout output
cha -d "include:src/,stdout"
# include patterns and save to file (default)
cha -d "include:src/**/*.py,*.md"
# include specific files with compression
cha -d "include:src/main.py,config.py,compress"
# include all with compression and stdout output
cha -d "all,compress,stdout"
Complex Real-World Examples:
# frontend project: include react components and styles
cha -d "include:src/components/,src/styles/,public/index.html,package.json"
# backend api: include core logic and configs
cha -d "include:src/controllers/,src/models/,src/routes/,config/,*.json,stdout"
# python project: include source and tests
cha -d "include:src/,tests/,*.py,requirements.txt,README.md"
# documentation and config files only
cha -d "include:*.md,*.yml,*.json,docs/,stdout"
Pattern Matching Rules:
config.py matches exactly config.pysrc/ includes all files under the src/ directory*.py matches all Python files in the current directorysrc/**/*.py matches all Python files in src/ and its subdirectoriesInteractive Mode (Original):
The codedump feature uses fzf for an improved file selection experience when using interactive mode:
cd (supports direct paths like cd dirname and cd ..)select commandunselect commandhelp to see all available commandsMultiple Modes Available:
The codedump feature offers several modes to suit different workflows:
cha -d (interactive exclude/include selection)cha -d all (include all files)cha -d stdout (interactive with stdout output)cha -d all,stdout (include all with stdout output)The include: syntax provides precise control when you know exactly what you want to include, while the interactive mode remains available for exploration and discovery.
cha -rcha -r
# records voice, transcribes to text, and sends to ai model
cha --voice "<prompt>"!o to read out the last response using a voice.cha -acha -a "<question>"cha -a "what is the goal of life"
cha -l <FILE>cha -l index.js
cha -tcha -vcha --editor <FILE_PATH>cha -v
# or
cha --editor ./src/main.py
The interactive editor allows you to edit files with AI assistance. You can start it with or without a file path. If no path is provided, you can select a file using an fzf-based file picker.
cha -m <MODEL_NAME>cha -m "o3-mini"
cha -ocr <FILE> [> <OUTPUT_FILE>]cha -ocr ./README.md
cha -ocr meme.jpg > output.txt
cha -p "<PLATFORM_OR_URL|API_KEY_ENV>" -m "<MODEL_NAME>"
cha -p "https://api.deepseek.com|DEEP_SEEK_API_KEY" -m "deepseek-chat"
cha -p "llama3-70b-8192|GROQ_API_KEY" -m "llama3-70b-8192"
cha -p
./cha/config.py to see all supported platforms.cha -p
cha -p "<PLATFORM_NAME|OPTIONAL_MODEL_NAME>"
Refer to ./cha/config.py to see all supported platforms.
Here you can select a supported platform and a model on that platform in one line with no need for manually selecting a platform and/or model.
The model name is optional; you can just provide the platform name and manually select a model name. Or just provide both.
Please note, if the platform is not listed in the config or the model name is invalid, Cha will just error out.
Examples:
# cleanly select a supported platform and the name of a model supported on the platform
cha -p "groq|deepseek-r1-distill-llama-70b"
# cleanly select just the platform and select a model from that platform manually with user input later on
cha -p "groq"
cha --continue or cha -c - Resume the most recent conversation.cha -hs [exact] - Search and load previous chats. Fuzzy search is the default.cha --load-history <file_path> or cha -lh <file_path> - Load a specific chat history file.cha then type !hs [exact] during interactive mode to load a previous chat. Fuzzy search is the default.During an interactive chat session, you can switch platforms and models on the fly:
!p - Interactive platform selection (uses fzf for platform and model selection)!p <platform_name> - Switch to a specific platform (e.g. !p anthropic)!p <platform_name>|<model_name> - Switch to specific platform and model (e.g. !p groq|llama-3.1-8b)!m - Interactive model selection within current platform!m <model_name> - Switch to a specific model (e.g. !m gpt-4)Examples:
# start a chat
cha
# during the chat, switch to anthropic
!p anthropic
# switch to groq with specific model
!p groq|llama-3.1-8b
# switch back to openai
!p openai
# switch just the model within current platform
!m gpt-4o
All chat history is preserved when switching platforms, and exported chat history (!e) includes platform/model information for each message.
cha --select-modelcha --select-model <MODEL_NAME>cha --tokens -l <FILE>cha --tokens -l README.md
These appear frequently with "cha" followed by a question/request referencing programming, shell commands, or general tasks, for example:
cha how many seconds is in a daycha in python how can I save a dict to a jsoncha craft me a unix command to find all Cargo.tomlcha make me a simple flask APIIn essence, your unique "cha" CLI usage falls into these main patterns:
Note that when you run Cha directly, meaning it conducts a single call to the model through the CLI as an argument, you can use the optional -e argument. This will export all code/file blocks in the model's last response that are enclosed in markdown fences. This feature makes it easy for Cha to generate files, such as a Python script, and have them accessible on you system (current directory) without needing to manually create a file, select, copy, and paste the content into a file. You can do this by running Cha like this (example):
cha -e write me python code to find the area of a circle
When you run the example command above, it will answer your question in one shot, then grab the code/file the model generated and save it to a file in your current directory. The file(s) it create will be named something like this: export_a9570f7e.py. Cha considers file extensions, so if the content is a text file, Go code, etc., it will include that file extension as part of the file name. With this, you can run the code/file and/or edit it on your system without needing to manually create a file if needed.
Cha automatically detects when its output is being piped to another command and suppresses all UI elements, making it perfect for shell pipelines and automation. Here's a powerful example that creates intelligent git commits:
git add --all
git commit -m "$(
{
echo "here is my entire code... and here is all the changes i made... can you draft me a good git commit message for these changes with no emojis and simple and all lowercase."
echo
git diff HEAD
echo
git status --untracked-files=all
} | cha | cat
)"
This command automatically generates intelligent commit messages by analyzing your code changes. The pipe detection ensures clean output without any UI interference, making Cha seamlessly integrate into your development workflow.
Cha also supports and accepts additional parameters. Here is the help page for reference:
usage: cha [-h] [-l FILE] [-a] [-t] [-m MODEL] [-p [PLATFORM]] [-d [CODE_DUMP]] [-e] [-x SHELL_COMMAND] [-hs [{fuzzy,exact}]] [-r] [--voice] [-v [EDITOR]]
[-sm] [-ct] [-ocr OCR] [-i] [-c] [-P] [-V] [-lh LOAD_HISTORY_FILE]
[string ...]
A command-line tool for interacting with AI models from multiple providers.
positional arguments:
string Non-interactive mode, feed a string into the model
options:
-h, --help Show this help message and exit.
-l FILE, --load FILE Load a file to send to the model (interactive: !l)
-a, --answer Run deep answer search (interactive: !w)
-t, --ide Use a terminal text editor for input (interactive: !t)
-m MODEL, --model MODEL
Switch model (interactive: !m)
-p [PLATFORM], --platform [PLATFORM]
Switch platform (interactive: !p)
-d [CODE_DUMP], --codedump [CODE_DUMP]
Codedump a directory (interactive: !d). Options: all, stdout, compress, include:path1,path2 or combine: include:src/,stdout
-e, --export Export code blocks from the last response (interactive: !e)
-x SHELL_COMMAND, --shell SHELL_COMMAND
Execute a shell command (interactive: !x)
-hs [{fuzzy,exact}], --history [{fuzzy,exact}]
Search history. 'fuzzy' (default), 'exact' for exact. (interactive: !hs)
-r, --record Record voice prompt (interactive: !r)
--voice Read out the response from the model using a voice.
-v [EDITOR], --editor [EDITOR]
Run the interactive editor (interactive: !v)
-sm, --select-model Select a model from a list
-ct, --tokens Count tokens for the input
-ocr OCR, --ocr OCR Extract text from a file using OCR
-i, --init Initialize cha config directory
-c, --continue Continue from the last chat session.
-P, --private Enable private mode (no history saved)
-V, --version Show version information
-lh LOAD_HISTORY_FILE, --load-history LOAD_HISTORY_FILE
Load a chat history from a file.
For those interested in contributing or experimenting with Cha:
Install Cha in Editable Mode:
pip install -e .
Develop and Test: Modify the source code and test changes using cha.
(Optional) Load your Custom Configuration: Use the CHA_PYTHON_CUSTOM_CONFIG_PATH environment variable to point to a custom config.py file that overrides default global variables. Set it using export CHA_PYTHON_CUSTOM_CONFIG_PATH="/path/to/your/config.py". Ensure your defined variables are in uppercase.
(Optional) Run code formatter if changes are made to Cha's codebase: To keep the code clean and organized, make sure to run the Cha's code formatter which is fm.
The assets/ directory contains supplementary materials, tools, and examples to enhance Cha's functionality. Here's a quick rundown:
assets/local_config/: Resources for setting up local configurations and custom external tools. It includes an example weather tool to demonstrate how you can extend Cha's capabilities.assets/macos_app/: A simple setup to create a macOS .app launcher for Cha using AppleScript, designed to open Cha in a Kitty terminal session.assets/sxng_search/: Scripts and documentation for integrating SearXNG, a self-hostable meta-search engine, as an alternative to DuckDuckGo for web-related features.assets/dev_tools/: A collection of utility scripts for development and maintenance, including a checkup.py script to verify your setup and update.py to help manage package versions.Cha now supports switching between AI platforms using the --platform argument, enabling interoperability with OpenAI-compatible APIs.
cha -p
Running cha -p opens a menu to select a platform. To skip the menu, provide the base URL, environment variable name, and model name directly. For example, to use the DeepSeek-V3 model from together.ai:
# get and set the provider's api key env variable
export TOGETHER_API_KEY="..."
# run cha with a different provider/platform
cha -p "https://api.together.xyz/v1|TOGETHER_API_KEY" -m "deepseek-ai/DeepSeek-V3"
Also, you can refer to the config.py file and the THIRD_PARTY_PLATFORMS variable to see all the other platforms you can try and/or use.
Cha lets you store local files to tweak how it works, including:
Once local history is enabled, features like browsing and searching your past chats are available using the -hs flag or !r during an interactive session.
By default, this is turned off, so there's no need to create any local files for Cha to run. You can set up the local configuration directory by running:
cha -i
If you installed Cha using the install.sh script and want to create custom external tools that require third-party Python packages, you'll need to install those packages in Cha's virtual environment. Since the install script creates an isolated environment at $HOME/.cha/venv, any external packages your tools need should be installed there:
# activate Cha's virtual environment
source "$HOME/.cha/venv/bin/activate"
# install your tool's dependencies
pip install requests beautifulsoup4 numpy # example packages
# deactivate when done
deactivate
This only applies if you used the install.sh method. If you installed Cha via pip, pipx, or manually in your own environment, your external tools will automatically have access to packages installed in that same environment.
For more details, check out the documentation in docs and the example files in assets/local_config/.
If you have enabled the save chat history locally feature after configuring the local setup, but want to start a chat session that is not saved, you can use the following argument:
cha --private (-P)
Using this option will ensure your chat session is NOT saved locally. Think of it like Google Chrome's Incognito Mode but for Cha!
For specific features and advanced configurations, refer to these additional documentation files:
Local Configuration & External Tools: Complete guide for setting up local configurations, creating custom external tools, and extending Cha's functionality with user-defined tools.
macOS App Setup: Instructions for creating a macOS .app launcher that opens Cha in a Kitty terminal with your environment preloaded.
SearXNG Integration: Setup guide for using SearXNG, a self-hostable meta-search engine, as an alternative to DuckDuckGo for web search features.
Development Utilities: Collection of utility scripts for testing, monitoring usage statistics, checking setup, and development maintenance.
Weather Tool Example: Example external tool implementation that demonstrates how to create custom tools for Cha using the wttr.in weather API.
Cha can use SearXNG, an open-source meta-search engine you can self-host, for all web and answer search features. This is completely optional but recommended for heavy users or those who want full control. To enable SearXNG in Cha:
Follow the setup instructions in assets/sxng_search/README.md (includes a one-command Docker setup and a Python usage example).
Set the following in your $HOME/.cha/config.py:
CHA_USE_SEAR_XNG=True
# change if your SearXNG runs elsewhere
CHA_SEAR_XNG_BASE_URL="http://localhost:8080"
Now start using cha and you will see that the SearXNG engine will be used instead of DuckDuckGo.
If not enabled, Cha continues to use DuckDuckGo by default.
Cha takes a fundamentally different approach from autonomous AI coding CLIs like Claude Code CLI, Gemini CLI, and OpenAI Codex CLI.
| Aspect | Cha | Agentic CLIs (Claude Code, Gemini etc.) |
|---|---|---|
| Control | Total user control at every step | Automated workflow decisions |
| Background Processing | No background AI workers | Smart agents make autonomous decisions |
| Context Management | Explicit user-controlled context | AI managed context and file handling |
| Cost | $1 to $20 per month for daily active use | $10 to $200+ per month for similar usage |
| Editing | No surprise edits, user guided | Autonomous code modifications |
| Use Case | Deep involvement, cost control | Rapid prototyping, delegation |
There is no silver bullet when it comes to a tool. No tool is perfect and can account for every case scenario in their area/field. That same applies to Cha. Cha is great for cost-effective daily tasks and precise control while tools like Claude Code and Gemini CLI are great when the goal is to do more complex coding tasks across multiple files and environments, with the focus on fast development and automation. Use Cha when you want to reduce cost of using AI tools, choose agentic tools when you need rapid iteration and do not mind delegating control, and consider starting with Cha to learn AI interaction patterns before exploring agentic tools as your needs evolve.
Contributions are welcome and appreciated! Cha is an open-source project that benefits from community involvement.
# clone the repository
git clone https://github.com/MehmetMHY/cha.git
cd cha
# install in development mode
pip install -e .
# run the checkup to verify your setup
python3 assets/dev_tools/checkup.py
Cha is licensed under the MIT License. See LICENSE for more details.
GitHub checked 63h ago - refresh overdue. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.