# gptme — AI Agent in Your Terminal > Personal AI assistant that writes code, runs commands, browses the web, and builds persistent agents. In your terminal. 3.7K+ stars. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: # gptme — AI Agent in Your Terminal ## Quick Use ```bash pip install gptme ``` ```bash export OPENAI_API_KEY="sk-..." # Or: export ANTHROPIC_API_KEY="sk-ant-..." # Start chatting gptme "Create a Python script that scrapes HN top stories" # Continue a previous conversation gptme --resume # Use Claude gptme --model anthropic/claude-sonnet-4-6 "Refactor this function" ``` --- ## Intro gptme is a personal AI assistant with 3,700+ GitHub stars that lives in your terminal and is equipped with local tools. Unlike cloud-based AI assistants, gptme runs commands on your machine, edits your files directly, browses the web, and executes code — all with your confirmation. Built for developers who prefer the terminal over IDEs, it supports OpenAI, Anthropic Claude, local models via Ollama, and lets you build persistent autonomous agents. Think of it as a minimalist, hackable terminal AI agent. Works with: OpenAI, Anthropic Claude, Google Gemini, Ollama (local), any OpenAI-compatible API. Best for terminal-native developers wanting an AI pair programmer in the shell. Setup time: under 2 minutes. --- ## gptme Capabilities ### Local Tool Use | Tool | What It Does | |------|-------------| | **Shell** | Execute any shell command (with confirmation) | | **Python** | Run Python code in a persistent REPL | | **File Read/Write** | Read, create, and edit files directly | | **Web Browser** | Fetch and parse web pages | | **Vision** | Analyze images and screenshots | | **Git** | Commit, diff, and manage repositories | ### How It Works ``` $ gptme "Set up a FastAPI project with SQLite" Assistant: I'll create the project structure. > Creating main.py... > Creating requirements.txt... > Running: pip install -r requirements.txt [confirm? y/n] y > Running: python main.py Server running at http://localhost:8000 ``` Every destructive action requires your confirmation. You stay in control. ### Persistent Conversations ```bash # All conversations are saved locally gptme --resume # Continue last conversation gptme --list # List all conversations gptme --name "my-project" # Named conversations ``` ### Autonomous Agents Build long-running agents on top of gptme: ```bash # Run without confirmation (autonomous mode) gptme --non-interactive "Monitor the API every 5 min and alert on errors" ``` ### Multi-Provider Support ```bash # OpenAI gptme --model openai/gpt-4o "..." # Anthropic gptme --model anthropic/claude-sonnet-4-6 "..." # Local via Ollama gptme --model ollama/llama3 "..." # Any OpenAI-compatible endpoint export OPENAI_BASE_URL="http://localhost:11434/v1" gptme "..." ``` ### File Operations ``` $ gptme "Read main.py and add error handling to the API endpoints" Assistant: Let me read the file first. > Reading main.py... I see 3 endpoints without try/except. I'll add proper error handling. > Writing main.py (3 changes)... [confirm? y/n] ``` --- ## FAQ **Q: What is gptme?** A: gptme is a terminal-based AI assistant with 3,700+ GitHub stars that can execute shell commands, write code, edit files, and browse the web on your local machine, with multi-provider LLM support. **Q: How is gptme different from Claude Code or Aider?** A: gptme is minimalist and hackable — a single pip install, no complex setup. Claude Code is Anthropic's full-featured CLI. Aider specializes in git-aware code editing. gptme focuses on being a general-purpose terminal agent you can extend and automate. **Q: Is gptme free?** A: Yes, open-source under MIT license. You bring your own LLM API keys. --- ## Source & Thanks > Created by [Erik Bjare](https://github.com/ErikBjare). Licensed under MIT. > > [gptme](https://github.com/ErikBjare/gptme) — ⭐ 3,700+ --- ## 快速使用 ```bash pip install gptme export OPENAI_API_KEY="sk-..." gptme "创建一个爬取HN头条的Python脚本" ``` --- ## 简介 gptme 是一个拥有 3,700+ GitHub stars 的终端 AI 助手,配备本地工具。可在你的机器上运行命令、编辑文件、浏览网页和执行代码。支持 OpenAI、Anthropic Claude、Ollama 本地模型。极简、可扩展的终端 AI 代理。 适用于:OpenAI、Claude、Gemini、Ollama。适合偏好终端的开发者。 --- ## 来源与感谢 > Created by [Erik Bjare](https://github.com/ErikBjare). Licensed under MIT. > > [gptme](https://github.com/ErikBjare/gptme) — ⭐ 3,700+ --- Source: https://tokrepo.com/en/workflows/a46522d1-b3a1-4e5e-a846-156f9bca0cc6 Author: TokRepo精选