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¶
-
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.
-
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, planner, 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.
-
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.
-
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 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, 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 -
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, and/revieware the built-in slash commands. -
Logs, cache resets, and the
doctorcommand.