Skip to content

Pegg Overview

Pegg is a provider-agnostic AI coding agent written in Go. It runs as an interactive terminal application, a headless CLI, an HTTP API server, an Agent Client Protocol server, or as an embeddable Go SDK.

The agent can read and edit files, run shell commands, search the web, manage todos, delegate work to subagents, load skills, follow project rules, and talk to MCP and language servers — all inside a sandboxed workspace.

What is Pegg

  • Multi-provider by design

    Bring your own key for 32 cloud providers, or point a generic OpenAI-compatible driver at any local or self-hosted endpoint. Models are discovered from the provider API and enriched with context-window, pricing, and capability metadata.

  • Built for the terminal

    A tcell-based TUI with streaming markdown, syntax-highlighted diffs, tool cards, a subagent view, live context/cost tracking, 26 themes, and @// pickers.

  • Permissions you control

    Five permission modes per tool, an LLM judge, a persistent allow/reject store, a VFS sandbox with .gitignore awareness, and double-Esc emergency stop.

  • Subagents and parallel work

    The orchestrator delegates to explorer, planner, and developer subagents, which run concurrently, persist their state, and can be resumed with follow-up messages.

  • Reminders

    System reminders keep every agent informed mid-turn: usage and context-window status, background subagent results, and more — injected automatically.

  • Project memory

    A markdown-based memory system: an observer distills every run into observations, a librarian curates them, and future runs get a budget-bounded memory panel of what was done, decided, and learned.

  • Connect to the web

    Pair the app on your machine with the Pegg website and chat with your agent from a browser — sessions, settings, and tools stay local, and only a one-time pairing token is needed.

  • Extensible

    Skills, rules, MCP servers, LSP servers, custom tools, middlewares, providers, agents, and an event bus with WordPress-style hooks.

  • Automation ready

    Run one-shot headless prompts from CI, or expose the agent over a REST API (with SSE streaming) and ACP for editor integrations.

Model Access

Pegg does not proxy your requests through a hosted service. You configure providers locally and every request goes straight from your machine to the provider.

  • Bring your own key — add providers with pegg login, the TUI settings page, or directly in ~/.peggco/pegg.json.
  • Custom endpoints — use the generic openai, claude, or gemini driver with a base_url to target any compatible gateway.
  • Local runtimes — anything speaking the OpenAI chat-completions API works, for example a locally hosted inference server.

See Providers & Models for the full list and Config for the configuration reference.

Applications

These are end-user applications built on top of Pegg's agent core:

  • CLI

    Interactive chat or fully headless automation for CI/CD and scripting. Piped stdin becomes the prompt; output streams as plain text.

    pegg run "explain this repository"

  • TUI

    The default interface. Run pegg with no arguments on a terminal to open the chat UI with attachments, subagent transcripts, and live settings.

    pegg

  • Server

    A REST API with session management and Server-Sent Events streaming, plus an ACP endpoint for editor clients.

    pegg serve

  • ACP

    Speak JSON-RPC 2.0 with the agent over stdio, HTTP+SSE, or WebSocket.

    pegg serve --acp --stdio

  • Go SDK

    Embed the engine in your own Go program: chat, completions, sessions, files, tools, and events.

    go get github.com/peggco/pegg/pkg/sdk

Next steps