Personal AI assistant that writes code, runs commands, browses the web, and builds persistent agents. In your terminal. 3.7K+ stars.
TO
TokRepo精选 · Community
Quick Use
Use it first, then decide how deep to go
This block should tell both the user and the agent what to copy, install, and apply first.
```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+
Discussion
Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.