gptme#
gptme is a chat-CLI for LLMs, empowering them with tools to run shell commands, execute code, read and manipulate files, and more.
If PROMPTS are provided, a new conversation will be started with it. PROMPTS can be chained with the ‘-’ separator.
Run ‘gptme-util –help’ for all utility commands.
Usage
gptme [OPTIONS] [PROMPTS]...
Options
- --name <name>#
Conversation ID (used to resume). Defaults to a random name.
- -m, --model <model>#
Model to use, e.g. {model_examples}. If only provider given then a default is used.
- --agent-path <agent_path>#
Path to agent workspace directory.
- -r, --resume#
Load the most recent conversation in this workspace. Use –name ID to select one.
- -y, --no-confirm#
Skip all confirmation prompts.
- -n, --non-interactive#
Non-interactive mode. Implies –no-confirm.
- --output-format <output_format>#
Output format for non-interactive mode. ‘json’ emits one JSON object per line on stdout.
- Options:
text | json
- --system <prompt_system>#
System prompt [full|full-noexamples|short|<custom>]. Defaults to ‘full’, or the value of system in gptme.toml [prompt] if set. ‘full-noexamples’ omits tool examples (~40% token reduction).
- -t, --tools <tool_allowlist>#
Tools to allow. Comma-separated or repeated. Use ‘+tool’ to add to defaults (e.g., ‘-t +subagent’). Use ‘-tool’ to exclude from defaults (e.g., ‘-t=-browser’). Use ‘none’ to disable all tools. Supports .py file paths for custom tools (e.g., ‘-t path/to/tool.py’). See ‘Available tools’ above for the list.
- --agent-profile <agent_profile>#
Agent profile to use. Profiles provide system prompts, tool access hints, and behavior rules. Use ‘gptme-util profile list’ to see available profiles.
- --tool-format <tool_format>#
Tool format to use.
- Options:
markdown | xml | tool
- --prune-tool-output, --no-prune-tool-output#
Use a summary model to keep only the relevant lines from large shell/read tool outputs.
- --stream, --no-stream#
Stream responses
Show hidden system messages.
- --show-prompt-stats#
Show startup system-prompt token stats for the current configuration and exit.
- -v, --verbose#
Show verbose output.
- --version#
Show version. With -v/–verbose, show full configuration info.
- --version-json#
Show version info as JSON (machine-readable, for scripting).
- --profile#
Enable profiling and save results to gptme-profile-{timestamp}.prof
- --context-budget <context_budget>#
Compaction threshold as a window fraction (0<x≤1) or absolute tokens (>1).
- --context <context_include>#
Context to include (default: all). Comma-separated or repeated. Tools and agent config (–agent-path) are always included.
- --no-workspace#
Skip all workspace context (prompt files and context_cmd). Tools and agent config are still included.
- --allow-hosts <allow_hosts>#
Comma-separated hostnames the agent may access via web tools (e.g. ‘github.com,*.googleapis.com’). Default: unrestricted. Wildcard subdomains supported.
Arguments
- PROMPTS#
Optional argument(s)
Environment variables
- GPTME_ALLOW_HOSTS
Provide a default for
--allow-hosts