Open Interpreter Guide
pip install open-interpreter # or: uv tool install open-interpreter # Set API key (or use local models): export OPENAI_API_KEY=sk-... # Requires: Python 3.10+
Open Interpreter lets LLMs write and execute code on your machine. Say "find all large files over 1GB and compress them" and it will run `find`, `gzip`, and report results — hands-free. It's like ChatGPT with a terminal and filesystem permissions.
Unlike Aider (which edits your codebase), Open Interpreter runs arbitrary commands and scripts. It can analyze CSV files with pandas, resize images with PIL, scrape websites, read/write files, install packages, and manage system processes. Each action requires confirmation by default.
Safety: use `--safe` mode (approve every action) or `--debug` (show code before running). Use `--os` for Mac-specific automation (AppleScript, shortcuts). For local models, run with `interpreter --model ollama/llama3.2`. GUI: ChatGPT Code Interpreter (cloud), OI in terminal is the local alternative.
Setup
interpreter # Chat mode — type natural language commands # One-shot commands: interpreter -e "List all Python files in this directory sorted by size" interpreter -e "What processes are using the most memory?"
# Ollama: interpreter --model ollama/llama3.2 # Custom API: export OPENAI_API_BASE=http://localhost:11434/v1 interpreter --model openai/llama3.2 # Anthropic: export ANTHROPIC_API_KEY=sk-ant-... interpreter --model claude-3-sonnet-20241022
File Operations
# Commands during session: "Find all files larger than 100MB in /home" "Rename all .jpeg files to .jpg in this directory" "Show me the last 50 lines of server.log" "Find all TODO comments in the codebase and count them" "Compare these two CSV files and show differences"
Data Analysis
"Load the sales.csv and show me total revenue by month" "Download this URL, extract the table, and save as JSON" "Plot the distribution of ages from users.csv" "Query the SQLite database and show top 10 customers" "Merge these two JSON files by the id field"
"Convert all Python type comments to type annotations" "Replace all `axios` calls with `fetch` in the project" "Convert these JavaScript files to TypeScript" "Upgrade the syntax in this Python 2 file to Python 3"
System Tasks
"Kill all node processes that are running for more than 1 hour" "Create a cron job that cleans /tmp every day at 3am" "Backup the project directory to a tar.gz file" "Find duplicate files in Downloads" "Convert all .docx files to .md using pandoc"
"Scrape the HN front page and show the top 5 stories" "Check if example.com is up and report HTTP status" "Download all images from this URL" "Check if my SSL cert expires within 30 days"
Safety
interpreter --safe # Ask for each action (default) interpreter --debug # Show code before running interpreter --safe_mode all # Approve everything interpreter --auto_run # Automatic (dangerous!) # Offline mode: interpreter --offline