AI should be a Unix tool, not a chat window.
npm install -g unix-ai
export OPENAI_API_KEY="sk-..."
ai "write a python web server"Every terminal user needs AI. But every AI tool wants you to open a chat window, log in, paste your code, click buttons.
That's not how Unix works.
In Unix, you pipe:
cat error.log | grep "Error"
curl api.example.com | jq '.data'
git diff | ai "write a commit message"ai turns LLMs into a Unix pipe command — like grep for intelligence, like jq for language.
# Fix bugs without leaving the terminal
cat buggy.py | ai "find and fix the bug"
# Write documentation from code
cat src/*.js | ai "generate API docs in markdown"
# Translate anything on the fly
curl https://news.ycombinator.com | ai "summarize top 5 stories in Chinese"
# Explain errors instantly
node server.js 2>&1 | ai "explain this error and suggest a fix"No config. No login. No GUI. Just pipes, models, and results.
npm install -g unix-ai| Platform | Download |
|---|---|
| macOS | brew install pipe-ai |
| Linux | `curl -fsSL https://pipe-ai.sh/install |
| Windows | scoop install pipe-ai |
Set any API key and you're ready:
# Option A: OpenAI
export OPENAI_API_KEY="sk-..."
# Option B: Anthropic
export ANTHROPIC_API_KEY="sk-ant-..."
# Option C: DeepSeek (cheapest!)
export DEEPSEEK_API_KEY="sk-..."
# Option D: Local (free!)
# Install Ollama, then:
export OLLAMA_HOST="http://localhost:11434"
# Option E: Run the wizard
ai initai "explain TCP/IP in one sentence"cat notes.txt | ai "summarize this"
curl api.github.com/repos/opencode-ai/opencode | ai "explain this JSON response"
git log --oneline | ai "generate release notes"
ps aux | ai "which process is using the most memory and should I kill it?"ai -p anthropic "design a React component"
ai -m gpt-4o "write a Rust function"
ai -p deepseek "optimize this SQL query"ai -s "you are a senior Rust developer" "review this code" < src/main.rsai -v "describe this UI screenshot and suggest improvements" < screenshot.png| Provider | Env variable | Default model |
|---|---|---|
| OpenAI | OPENAI_API_KEY |
gpt-4o |
| Anthropic | ANTHROPIC_API_KEY |
claude-sonnet-4-20250514 |
| DeepSeek | DEEPSEEK_API_KEY |
deepseek-chat |
| Google Gemini | GOOGLE_API_KEY |
gemini-2.0-flash |
| OpenRouter | OPENROUTER_API_KEY |
openai/gpt-4o |
| Ollama (local) | OLLAMA_HOST |
llama3 |
# Code review
git diff main | ai -s "you are a senior engineer. find security issues and bugs" > review.md
# Error debugging
npm test 2>&1 | ai "explain why these tests fail and how to fix them"
# Data transformation
cat data.csv | ai "convert this to JSON with proper schema" > data.json
# Documentation
find src -name "*.js" -exec cat {} + | ai "generate README documentation" > README.md
# Commit messages
git diff --cached | ai "write a conventional commit message" | pbcopy
# Learning
man rsync | ai "explain rsync like I'm 12 years old"
# Quick translation
cat README.md | ai "translate this to Japanese, preserve markdown formatting" > README.ja.mdUnix has grep for text, jq for JSON, sed for transformations.
AI is a new primitive. It deserves to be a pipe command — composable, scriptable, chainable with everything else.
cat error.log | grep "Error" | ai "find the root cause" | tee fix.txt
This isn't a product. It's a missing Unix command that should have existed since the terminal was invented.
PRs welcome! See CONTRIBUTING.md.
Ideas for contributions:
- Add more providers (Mistral, Cohere, Groq, etc.)
- Streaming output support
- Syntax highlighting for code output
- Token counting and cost estimation
- Homebrew formula
- Windows installer
MIT — do whatever you want.
AI is a pipe command.
cat problem | ai "solve it"