Skip to content

0dust/pipe-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pipe-ai

Use any LLM in Unix pipelines. Zero config.

Already have Claude Code? Install pipe-ai and it works immediately — no API key needed, your Max/Pro subscription powers it.


Demo

git diff → changelog

git diff | ai "write a changelog entry" demo

Pipe to jq

cat logs.json | ai "extract emails" --json | jq demo

Everyday utility

ps aux | ai "what's using my memory" demo


Install

# macOS (Homebrew)
brew install pipe-ai

# Linux / macOS (direct)
curl -fsSL https://pipe-ai.dev/install.sh | sh

# Go
go install github.com/pipe-ai/pipe-ai@latest

How it works

pipe-ai auto-detects the best available LLM on your machine and uses it. No configuration required.

Provider setup

Provider Setup Cost
Claude Code (default if installed) Already done — claude --version Your subscription
Ollama (local, private) brew install ollama && ollama pull llama3.2 && ollama serve Free
Anthropic API export ANTHROPIC_API_KEY=sk-ant-... Pay-per-use
OpenAI API export OPENAI_API_KEY=sk-... Pay-per-use
Groq API export GROQ_API_KEY=gsk_... Pay-per-use

Resolution order

pipe-ai tries providers in this exact order until one works:

  1. Ollama running on localhost:11434 (local, private, free)
  2. claude CLI binary authenticated (Claude Code OAuth)
  3. ANTHROPIC_API_KEY → claude-haiku-4-5
  4. OPENAI_API_KEY → gpt-4o-mini
  5. GROQ_API_KEY → llama3-70b-8192

Claude Code users: If you also have ANTHROPIC_API_KEY set in your environment, the claude binary will use it instead of OAuth, charging at API rates rather than your subscription. To force OAuth: ai "prompt" --model claude-cli To check which auth is active: claude /status


Usage examples

# Translate
echo "hello world" | ai "translate to French"

# Analyze logs
cat server.log | ai "are there any errors or anomalies"

# Generate changelog from recent commits
git diff HEAD | ai "write a changelog entry" >> CHANGELOG.md

# Find memory hog
ps aux | ai "what process is using the most memory and why is that a problem"

# Extract structured data and pipe to jq
cat api-response.json | ai "extract all user emails" --json | jq '.[]'

# Process a huge log file in chunks
cat massive.log | ai "summarize all errors" --chunk

# See what would be sent to the model (no API call)
cat code.py | ai "find bugs" --dry

Flags

Flag Description
--model Override model resolution (e.g. ollama/llama3.2, anthropic/claude-haiku-4-5, claude-cli)
--json Output as valid JSON (validated, retried once if invalid)
--csv Output as RFC 4180 CSV with header row
--raw Plain text output (default — same as no flag)
--dry Print full prompt to stderr, make zero API calls
--chunk Split oversized input into chunks, synthesize results
--force Truncate input exceeding context window without warning
--models List all available models across configured providers

Context window handling

pipe-ai never silently truncates your input.

Input size Behavior
< 70% of limit Process normally
70–95% of limit Warning on stderr, process normally
> 95% of limit Error — use --chunk or --force
# Process a 50K-line codebase
find . -name '*.py' | xargs cat | ai "find security vulnerabilities" --chunk

Claude Code integration

Claude Code users are already authenticated via OAuth. pipe-ai shells out to the claude binary as a subprocess — it never touches your credentials, never reads your keychain, and respects your subscription tier automatically.

# This is all you need if you have Claude Code:
brew install pipe-ai
echo "test" | ai "hello"

Contributing

git clone https://github.com/pipe-ai/pipe-ai
cd pipe-ai
go build -o ai .
codesign -s - ./ai   # macOS only
echo "hello" | ./ai "translate to Spanish"

PRs welcome. Keep changes focused on making the pipe more useful — not turning it into a platform.


License

MIT — see LICENSE

About

Use any LLM in Unix pipelines

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors