Crush: The AI-Powered CLI That Feels Like Pair Programming
If you've ever been deep in a terminal workflow and wished you had a pair programmer to bounce ideas off of, or just someone to handle that tedious data transformation, you know the feeling. Most AI coding tools live in your IDE or a browser tab, creating a context switch that breaks your flow. What if your AI companion lived right where you work—in the command line?
That's exactly what Crush from Charmbracelet is. It’s not just another CLI tool to memorize; it's a context-aware AI assistant that integrates directly into your shell. It understands your current directory, your open files, and your git status, turning natural language requests into precise shell commands and scripts.
What It Does
Crush is a TUI (Terminal User Interface) application that connects to an AI model (like OpenAI's GPT-4) and acts as a bridge between your plain English requests and your shell environment. You ask it a task—"find all the Go test files modified in the last week"—and it suggests the correct find or git command. More impressively, it can write small scripts, explain complex commands, and process the files in your current project, all while staying within the terminal.
Why It's Cool
The magic of Crush is in its context awareness. When you run it, it automatically gathers information about your current working directory, recent git history, and even the contents of relevant files. This means you can ask things like "What did I change in the last commit?" or "Add a comment to this function in my open file," and it has the information needed to help.
It's built with the Charmbracelet ecosystem, known for tools like Glow and Lip Gloss, which means the TUI is polished, responsive, and a genuine pleasure to use. It feels like a native part of your terminal, not a clunky web app grafted on.
Beyond generating commands, it can execute them for you after confirmation, creating a safe, interactive loop. This makes it an incredible learning tool for newer developers and a massive productivity booster for veterans who don't want to leave the keyboard to look up arcane awk syntax.
How to Try It
You'll need Go installed to build it from source. Getting started is straightforward:
Clone the repo:
git clone https://github.com/charmbracelet/crush.git cd crushBuild it:
go buildSet your OpenAI API key: You need an API key from OpenAI.
export OPENAI_API_KEY='your-key-here'