gptme

Your agent in your terminal, equipped with local tools: writes code, uses the terminal, browses the web, vision.

MIT License

Downloads
2.2K
Stars
689
Committers
4

Website

Documentation

Table of Contents

Demos

[!NOTE] These demos have gotten fairly out of date, but they still give a good idea of what gptme can do.

You can find more Demos and Examples in the documentation.

Features

  • Code execution
  • Executes code in your local environment with the shell and python tools.
  • Read, write, and change files
  • Makes incremental changes with the patch tool.
  • Search and browse the web.
  • Can use a browser via Playwright with the browser tool.
  • Vision
  • Can see images referenced in prompts, screenshots of your desktop, and web pages.
  • Self-correcting
  • Output is fed back to the assistant, allowing it to respond and self-correct.
  • Support for several LLM providers
  • Use OpenAI, Anthropic, OpenRouter, or serve locally with llama.cpp
  • Many smaller features to ensure a great experience
  • Pipe in context via stdin or as arguments.
    - Passing a filename as an argument will read the file and include it as context.
  • Tab completion
  • Automatic naming of conversations
  • Optional basic Web UI and REST API

Developer perks

  • Easy to extend
  • Most functionality is implemented as tools, making it easy to add new features.
  • Extensive testing, high coverage.
  • Clean codebase, checked and formatted with mypy, ruff, and pyupgrade.
  • GitHub Bot to request changes from comments! (see #16)
  • Operates in this repo! (see #18 for example)
  • Runs entirely in GitHub Actions.
  • Evaluation suite for testing capabilities of different models

In progress

  • Advanced evals for testing frontier capabilities
  • Long-running agents and advanced agent architectures
  • Tree-based conversation structure (see #17)

Use Cases

  • Shell Copilot: Figure out the right shell command using natural language (no more memorizing flags!).
  • Development: Write, test, and run code with AI assistance.
  • Data Analysis: Easily perform data analysis and manipulations on local files.
  • Learning & Prototyping: Experiment with new libraries and frameworks on-the-fly.
  • Agents & Tools: Experiment with agents and tools in a local environment.

Getting Started

Install with pipx:

# requires Python 3.10+
pipx install gptme

Now, to get started, run:

gptme

Here are some examples:

gptme 'write an impressive and colorful particle effect using three.js to particles.html'
gptme 'render mandelbrot set to mandelbrot.png'
gptme 'suggest improvements to my vimrc'
gptme 'convert to h265 and adjust the volume' video.mp4
git diff | gptme 'complete the TODOs in this diff'
make test | gptme 'fix the failing tests'

For more, see the Getting Started guide and the Examples in the documentation.

Usage

$ gptme --help
Usage: gptme [OPTIONS] [PROMPTS]...

  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.

  The interface provides user commands that can be used to interact with the
  system.

  Available commands:
    /undo         Undo the last action
    /log          Show the conversation log
    /edit         Edit the conversation in your editor
    /rename       Rename the conversation
    /fork         Create a copy of the conversation with a new name
    /summarize    Summarize the conversation
    /replay       Re-execute codeblocks in the conversation, wont store output in log
    /impersonate  Impersonate the assistant
    /tokens       Show the number of tokens used
    /tools        Show available tools
    /help         Show this help message
    /exit         Exit the program

Options:
  -n, --name TEXT        Name of conversation. Defaults to generating a random
                         name.
  -m, --model TEXT       Model to use, e.g. openai/gpt-4o,
                         anthropic/claude-3-5-sonnet-20240620. If only
                         provider given, a default is used.
  -w, --workspace TEXT   Path to workspace directory. Pass '@log' to create a
                         workspace in the log directory.
  -r, --resume           Load last conversation
  -y, --no-confirm       Skips all confirmation prompts.
  -n, --non-interactive  Force non-interactive mode. Implies --no-confirm.
  --system TEXT          System prompt. Can be 'full', 'short', or something
                         custom.
  --no-stream            Don't stream responses
  --show-hidden          Show hidden system messages.
  -v, --verbose          Show verbose output.
  --version              Show version and configuration information
  --help                 Show this message and exit.

Stats

Stargazers over time

Download Stats

Links

Package Rankings
Top 33.94% on Pypi.org
Badges
Extracted from project README's
demo screencast with asciinema 621992-resvg mandelbrot-curses superuserlabs-ceo Stargazers over time
Related Projects