Issues
GitHub for bugs and features.
Click here to add it to your calendar: add to calendar
Here we ask pig to build a custom workflow extension with custom TUI to streamline the commit and push process.
This is just a small selection of models you can pick from.
You can rewind to any prior message, branch from there and share the entire session with others.
pig supports skills, AGENTS.md files and is very token efficient due to its minimal system prompt.
Press Enter to steer the current run immediately, or Alt+Enter to queue a follow-up once it finishes.
We use the pig TUI here to build a pig-based shell script that uses print mode.
This demonstrates a customized pig installation using custom pure PHP extensions that extend the terminal UI and toolset.
pig is pi ported to PHP with zero runtime dependencies.Minimal agent core, Fiber async socket transport, native ANSI TUI.
curl -fsSL https://pigagent.dev/install.sh | shcomposer global require pigagent/piggit clone https://github.com/owner888/pig.git && cd pig && composer installpig is a minimal agent harness. Adapt pig to your workflows, not the other way around. Customize pig with extensions, skills, prompt templates, and themes. Bundle them as pig packages and share via Composer or Git.
pig ships with powerful defaults but skips features like sub-agents and plan mode. Ask pig to build what you want, or install a package that does it your way.
Four modes: interactive, print/JSON, RPC, and SDK.
pig isn't a sealed product. If you need a command, tool, provider, workflow, or UI tweak, just ask pig to build it. It will customize itself on the fly.
Have pig manipulate itself in place, hit /reload, and keep going. If you think others will find what you built useful, share it!
Anthropic, OpenAI, Google, Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, Kimi For Coding, MiniMax, NVIDIA, OpenRouter, Ollama, and more. Authenticate via API keys or OAuth.
Switch models mid-session with /model or Ctrl+L. Cycle through your favorites with Ctrl+P.
Add custom providers and models via models.json or extensions.
Sessions are stored as trees. Use /tree to navigate to any previous point and continue from there. All branches live in a single file. Filter by message type, label entries as bookmarks.
Export to HTML with /export, or upload to a GitHub gist with /share and get a shareable URL that renders it.
pig's minimal system prompt and extensibility let you do actual context engineering. Control what goes into the context window and how it's managed.
AGENTS.md: Project instructions loaded at startup from ~/.pig/agent/ (and also compatible with ~/.pi/agent/), parent directories, and the current directory.
SYSTEM.md: Replace or append to the default system prompt per-project.
Compaction: Auto-summarizes older messages when approaching the context limit. Fully customizable via extensions: implement topic-based compaction, code-aware summaries, or use different summarization models.
Skills: Capability packages with instructions and tools, loaded on-demand. Progressive disclosure without busting the prompt cache. See skills.
Prompt templates: Reusable prompts as Markdown files. Type /name to expand. See prompt templates.
Dynamic context: Extensions can inject messages before each turn, filter the message history, implement RAG, or build long-term memory.
Submit messages while the agent works. Enter sends a steering message (delivered after current tool, interrupts remaining tools). Alt+Enter sends a follow-up (waits until the agent finishes).
Interactive: The full TUI experience.
Print/JSON: pig -p "query" for scripts, --mode json for event streams.
RPC: JSON protocol over stdin/stdout for non-Node integrations. See docs/rpc.md.
SDK: Embed pig in your apps.
Features that other agents bake in, you can build yourself. Extensions are pure PHP scripts with access to tools, commands, keyboard shortcuts, events, and the full TUI.
Sub-agents, plan mode, permission gates, path protection, SSH execution, sandboxing, MCP integrations, custom editors, status bars, overlays.
Don't want to build it? Ask pig to build it for you. Or install a package that does it your way. See the 50+ examples.
Bundle pure PHP extensions, skills, prompts, and themes. Update or install from Git or Packagist:
$ pig update --extensions
$ pig update --models