gptme is an open-source, terminal-first AI agent designed for software engineering and system tasks, originally created by Erik Bjäreholt. Operating directly in standard terminal sessions, remote SSH environments, tmux sessions, and CI/CD pipelines, it acts as an unconstrained assistant capable of running shell commands, executing Python scripts, modifying local repositories, and automating browser tasks. In standard workflows, developers interact with gptme via an interactive terminal REPL, single-shot CLI commands, or a self-hosted web UI. The agent is provider-agnostic, supporting models from Anthropic (such as Claude 3.7 Sonnet), OpenAI, Google (Gemini), xAI (Grok), DeepSeek (R1), and OpenRouter, as well as offline local models via llama.cpp. When given a task, gptme inspects directory structures, generates targeted code edits using incremental patch and morph tools, runs test suites directly in your environment, and reads execution output to self-correct failures. What differentiates gptme is its extensive system integration and layered extensibility. It features an automated "lessons" engine that dynamically injects relevant context and rules into the prompt based on tool usage and keyword patterns, native support for Model Context Protocol (MCP) tools, background job execution, and tree-sitter-based structural code analysis (gptme-codegraph) for call graph and impact analysis. It also supports computer vision, desktop automation, and subagent orchestration for delegating complex workflows. gptme is free, open-source software distributed primarily through PyPI with standalone desktop packages available across Linux, macOS, and Windows. Users can connect standard provider API keys or use web-subscription auth without vendor lock-in.
Broad Model & Local LLM Support — Integrates with Anthropic, OpenAI, Google Gemini, xAI, DeepSeek, OpenRouter, and local models served via llama.cpp. - Direct Shell & IPython Execution — Executes terminal commands and inline Python code directly in your local environment or persistent tmux sessions. - Incremental File Editing — Inspects, modifies, and patches project files using dedicated read, write, patch, and morph tools. - Lessons & Skills Context System — Automatically injects contextual instructions and domain rules based on pattern matching, keywords, and active tools. - Code Intelligence via MCP & Tree-sitter — Provides structural code navigation, symbol retrieval, and blast-radius analysis via gptme-codegraph and MCP integrations. - Browser & Multi-Modal Automation — Browses websites using Playwright, captures desktop screenshots, and inspects visual assets. - Subagent & Autonomous Task Loops — Spawns isolated subagents to parallelize work and runs autonomous continuous execution loops.
Use cases
Use Case: Interactive Bug Fixing and Test Resolution A developer runs gptme against a repository with failing unit tests. The agent inspects the stack trace, parses code symbols using tree-sitter tools, patches the offending files, runs the test command in the shell, and repeats until the test suite passes.
Use Case: Headless Server and Remote Environment Automation An engineer launches gptme inside an SSH or tmux session on a remote server to triage system logs, run database maintenance scripts in the background, and verify service uptime without leaving the command line.
Use Case: Documentation-Driven API Integration A developer tasks gptme with building an integration for an external library. The agent uses its Playwright browser tool to fetch current documentation from the web, writes the implementation files locally, and validates the implementation against live endpoints.
Who it is for
gptme is intended for software engineers, DevOps practitioners, and command-line power users who need an extensible, local-first coding agent that can execute shell commands, run local models, and operate inside SSH or tmux sessions. It is less suitable for users looking for a locked-down, editor-only GUI assistant with no shell or system access.
Install guide
Installation Install gptme using pipx (recommended) or standard pip: bash pipx install gptme Or using pip: bash pip install gptme
First Run Set your desired model provider API key in your environment: bash # For Anthropic Claude: export ANTHROPIC_API_KEY="sk-ant-..." # Or for OpenAI: export OPENAI_API_KEY="sk-..." # Or for OpenRouter: export OPENROUTER_API_KEY="sk-or-..." Launch an interactive session: bash gptme Inside the session, run /tools to verify active tools and /help for available commands.
Example Session Execute a single-shot task directly from the CLI: bash gptme "Run pytest on tests/test_auth.py, diagnose any failures, and apply patches until all tests pass."
Gemini CLI — Gemini CLI is an open-source terminal coding agent maintained under the Google Gemini organization (google-gemini/gemini-cli). It provides a command-line and…
Open Interpreter — Open Interpreter is an open-source terminal coding agent maintained by Killian Lucas and the Open Interpreter community. It is designed…
Crush — Crush is an open-source terminal coding agent created by Charm (Charmbracelet), the team behind popular Go terminal UI libraries like…
Hax — Hax is a minimalist, native CLI coding agent created by Oleksandr Chekhovskyi. Written in C and designed for POSIX-compliant environments,…
San — San is an open-source terminal coding agent developed by the genai-io organization on GitHub. Built natively in Go, San is…
amux — amux is an open-source agent harness and session multiplexer developed by Mixpeek. Built in Rust, it is designed to manage,…