π LLM CLI Skill - START HERE
Welcome to the LLM CLI Skill! This document will get you started in 5 minutes.
What Is This?
A powerful Claude Code skill that gives you access to multiple LLM providers (OpenAI, Anthropic, Google, Ollama) through a simple command interface.
Use cases:
- β Process documents with AI
- β Quick text analysis and summarization
- β Code review and generation
- β Interactive conversations
- β Batch file processing
Quick Setup (5 minutes)
Step 1: Install llm CLI
pip install llm
Step 2: Add an API Key
Pick ONE of these (or do multiple):
OpenAI (GPT-4o, GPT-5):
export OPENAI_API_KEY='sk-proj-...'
Anthropic (Claude):
export ANTHROPIC_API_KEY='sk-ant-...'
Google Gemini:
export GOOGLE_API_KEY='...'
Ollama (Free, Local): No key needed! Just install from https://ollama.ai
Step 3: Verify Setup
/llm --setup
You're done! π
First Commands
Try a simple prompt:
/llm "What is the capital of France?"
Use a specific model:
/llm --model gpt-4o "Explain quantum computing"
Process a file:
cat myfile.txt | /llm "Summarize this"
Start a conversation:
/llm --interactive
# Type your questions, press Ctrl+C to exit
What You Get
| Feature | Details |
|---|---|
| 4 Providers | OpenAI, Anthropic, Google, Ollama |
| 30+ Models | Latest 2025 models from all providers |
| Smart Selection | Remembers your last model choice |
| File Support | Text, code, JSON, PDF, images, audio |
| Modes | Non-interactive or interactive chat |
| Aliases | Use gpt-4o or openai - both work |
Common Tasks
Summarize
/llm "Summarize in 3 bullet points" < long_document.txt
Code Review
/llm --model gpt-4o "Review this code for bugs" < main.py
Translate
/llm "Translate to Spanish" < article.md
Analyze Data
/llm "What patterns do you see?" < data.csv
Interactive Q&A
/llm -i --model claude-sonnet-4.5
# Ask questions in the chat loop
Model Recommendations
Choose by your needs:
| Goal | Model | Command |
|---|---|---|
| Fastest | gpt-4o-mini | /llm --model gpt-4o-mini |
| Best Quality | gpt-5 | /llm --model gpt-5 |
| Best Balance | claude-sonnet-4.5 | /llm --model claude-sonnet-4.5 |
| Free & Local | ollama | /llm --model ollama |
Next Steps
- Explore Models: Run
/llm --setupto see all available models - Read Full Guide: Open README.md for detailed docs
- Quick Reference: Check QUICKSTART.md
- Install Help: See INSTALL.md for detailed setup
Troubleshooting
"No providers found"
# Make sure you set an API key
echo $OPENAI_API_KEY
# If empty, set it again and reload shell
source ~/.zshrc
"llm command not found"
pip install llm
llm --version # Should show version
"Model not found"
/llm --setup # Shows all available models
"Permission denied"
chmod +x ~/.claude/skills/llm-cli/llm_skill.py
File Support
Works with:
- Text:
.txt,.md,.json,.log,.csv - Code:
.py,.js,.ts,.jsx,.tsx,.html,.css - Config:
.yaml,.yml,.toml,.xml - Media:
.pdf,.jpg,.png,.gif,.mp3,.wav
Example:
/llm "Fix the JSON" < config.json
cat code.ts | /llm "Type check this"
Pro Tips
- Remember Your Choice: Use any model once, then it's the default
- Pipe Anything:
cat file | /llm "process" - Quick Interactive:
/llm -istarts chat immediately - Combine with Shell:
grep ERROR app.log | /llm "analyze" - Multiple Providers: Set multiple API keys for flexibility
Command Reference
# Basic usage
/llm "Your prompt" # Uses remembered model
/llm "Prompt" < file.txt # From file
cat file | /llm "Process" # From pipe
# Model selection
/llm --model gpt-4o "prompt" # Specific model
/llm --model openai "prompt" # Specific provider
/llm --model claude-opus --interactive # Model + mode
# Modes
/llm --interactive # Interactive chat
/llm -i --model claude-sonnet-4.5 # Interactive + model
# Setup
/llm --setup # Detect providers
/llm --help # Show all options
Configuration File
Location: ~/.claude/llm-skill-config.json
Automatically created and updated. Shows:
- Last model used
- Available providers
- Provider settings
Edit manually if needed, but usually not necessary!
Security
- API keys stored in environment variables (not in config)
- Config file only stores model preferences (no secrets)
- All communication goes directly to providers
- Local models (Ollama) run entirely offline
Support
Problem? Check these in order:
- QUICKSTART.md - 5-minute overview
- README.md - Detailed documentation
- INSTALL.md - Setup troubleshooting
- IMPLEMENTATION_SUMMARY.md - Technical details
What's Inside
llm-cli/
βββ START_HERE.md β You are here! π
βββ QUICKSTART.md β 5-min setup
βββ README.md β Full guide (3000+ words)
βββ INSTALL.md β Detailed setup
βββ SKILL.md β Skill definition
βββ IMPLEMENTATION_SUMMARY.md β Technical details
βββ requirements.txt β Dependencies
β
βββ llm_skill.py β Main program
βββ models.py β Model registry
βββ providers.py β Provider detection
βββ executor.py β Execution engine
βββ input_handler.py β File handling
Examples by Use Case
Content Creation
/llm "Write a blog post about AI safety" < notes.txt
Code Tasks
cat broken.js | /llm "Fix syntax errors"
/llm --model gpt-5 "Refactor this" < legacy.py
Learning
/llm "Explain like I'm 5" < quantum_physics.pdf
/llm -i --model claude-opus # Ask follow-up questions
Data Analysis
/llm "Find trends in this data" < sales.csv
Writing/Editing
/llm "Fix grammar and improve clarity" < draft.txt
Bulk Processing
for file in *.txt; do
/llm "Summarize" < "$file" > "${file%.txt}_summary.txt"
done
Before You Go
β
Install llm: pip install llm
β
Set API key: export OPENAI_API_KEY='...' (or another provider)
β
Test: /llm "Hello"
β
Explore: /llm --setup
β
Read: Check README.md for advanced features
Ready? Start with:
/llm "Hello, world!"
Questions? Check the documentation files or run /llm --help
Enjoy! π