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, a VS Code extension, 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¶
-
Bring your own key for 33 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.
-
A tcell-based TUI with streaming markdown, syntax-highlighted diffs, tool cards, a subagent view, live context/cost tracking, 26 themes, and
@//pickers. -
Five permission modes per tool, an LLM judge, a persistent allow/reject store, a VFS sandbox with
.gitignoreawareness, and double-Escemergency stop. -
The orchestrator delegates to explorer and developer subagents, which run concurrently, persist their state, and can be resumed with follow-up messages.
-
System reminders keep every agent informed mid-turn: usage and context-window status, background subagent results, and more — injected automatically.
-
Run the agent on a cron schedule — daily summaries, weekly checks, recurring reminders — with each run saved as its own session. Fires while the TUI, server, or connect daemon is running.
-
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.
-
Centralize provider keys for a team. Owners add encrypted BYOK providers and defaults on the website; members connect with
pegg teamand use apegg-team <team>provider backed by the team's keys. -
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.
-
Skills, rules, MCP servers, LSP servers, custom tools, middlewares, providers, agents, and an event bus with WordPress-style hooks.
-
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 require a hosted service. You configure providers locally and every
BYOK request goes straight from your machine to the provider. Pegg Forever
(pegg-forever) is an optional first-party gateway at https://forever.pegg.dev/v1.
- Bring your own key — add providers with
pegg login, the TUI settings page, or directly in~/.pegg/pegg.json. - Pegg Forever — sign in with
pegg login-peggor paste an API key; the desktop and TUI first-run screens offer both. After login, Pegg can apply recommended models and settings from the Forever defaults document after showing you the changes. - Custom endpoints — use the generic
openai,claude, orgeminidriver with abase_urlto 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:
-
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" -
The default interface. Run
peggwith no arguments on a terminal to open the chat UI with attachments, subagent transcripts, and live settings.pegg -
A REST API with session management and Server-Sent Events streaming, plus an ACP endpoint for editor clients.
pegg serve -
Speak JSON-RPC 2.0 with the agent over stdio, HTTP+SSE, or WebSocket.
pegg serve --acp --stdio -
Chat, sessions, tools, permissions, voice input, and editor actions inside VS Code, backed by the local Pegg engine.
code --install-extension peggco.pegg-vscode -
The Pegg plugin for JetBrains IDEs embeds the same agent engine used by the CLI, TUI, and VS Code extension
idea installPlugins dev.pegg.ide -
A cross-platform desktop client for Pegg built with Wails v2 and a React 19 + TypeScript frontend.
https://github.com/peggco/pegg/releases -
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¶
-
Build or download the binary, then log in to a provider.
-
Every key in
~/.peggco/pegg.json, explained. -
/init,/batch,/orchestrate,/goal,/review,/rule, and/skillifyare the built-in slash commands. -
Logs, cache resets, and the
doctorcommand.