gptme CLI Cheatsheet - Terminal AI Agent Full Reference

gptme is a personal agent that lives in the terminal and carries its own shell, Python, web and vision tools. It reads files, runs commands and fans out to sub-agents without pinning you to one provider. What separates it from a chat assistant is that it acts rather than advises, which means the two things that decide whether it helps are context and permissions. Index the project so retrieval carries your codebase into the conversation, and grant or revoke individual tools with +tool and -tool rather than enabling everything, especially anywhere the run is unattended. For scripting, -y removes the interactive confirmation and --output-format json returns structured output; together they are the prerequisite for wiring it into CI or a long-running job. Sections cover basic conversation, tools and context, and session and tool management. Because it runs commands, treat prompts as input to a program under your control: prefer narrow tool grants, and read the output before piping it into anything else.

AI CLI·20 commands·Last updated 2026-09-10
gptmeaiagentclishellautomationlocal-first

Basic Chat 6

gptme "hello"
Start a chat with a prompt
gptme "fix TODOs" main.py
Start with file context
gptme -m anthropic/claude-sonnet-4-20250514
Select a model
gptme -y "run tests and fix"
Auto-confirm tool runs
gptme -n "summarize git diff"
Non-interactive mode (for CI)
gptme --output-format json "summarize diff"
JSON output for parsing

Tools and Context 6

gptme -t read-only "summarize repo"
Read-only tools, no writes
gptme -t patch,save "fix typo" main.py
Allow only named tools
gptme -t +subagent "plan refactor"
Add subagent to defaults
gptme -t=-browser "summarize code"
Remove browser from defaults
gptme --tools none "what is 2+2"
Disable all tools, chat only
gptme --context files "do task"
Skip context cmd, keep project files

Sessions and Tooling 8

gptme -r
Resume the latest session
gptme --name mytask
Name the session
gptme tools list
List available tools
gptme chats list
List past conversations
gptme models list
List available models
gptme context index
Index project files for RAG
gptme chats search "query"
Search past conversations
gptme --help
All flags

Tips

  • -y auto-confirm and -n non-interactive with --output-format json is the standard way to put it in CI.
  • -t with +tool or -tool adds or removes tools for fine-grained permission control, safer than all-on.
  • gptme context index builds RAG so chats carry project file context.

FAQ

How is gptme different from Claude Code?

gptme is provider-agnostic and local-first with 100+ models and concurrent agents; Claude Code is Anthropic official and Claude-native. Both run shell and code.

Can it run on a headless server?

Yes. -n non-interactive mode targets SSH, tmux, headless, and CI, with machine-readable output.

Official References

Each command links to its official documentation below, so you can verify the latest usage and read deeper.

Maintained by LaoHand

Publicly updated on Sep 10, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us