On this page
pig Packages
pig Packages
#pig packages bundle extensions, skills, prompt templates, and themes as a standalone unit for distribution.
Under pig's pure PHP architecture, extensions and packages are distributed as clean PHP scripts and directory conventions, loaded directly by the native runtime.
---
Installing & Managing Packages
#1. Update Official Extensions
#Synchronize official pure PHP extensions from the CLI:
pig update --extensions
This updates every installed package and walks ~/.pig/agent/extensions/: a folder that is a git checkout gets git pull; a folder with a composer.json gets composer update --no-dev (when composer is on PATH); a folder that matches one of pig's bundled extensions is synced from pig's extensions/ directory. Bundled extensions that are not there yet, such as pig-computer, pig-vless, pig-web-search, pig-antigravity, and pig-android-use, are copied in. The four built-in extensions (pig-mcp, pig-llama, pig-codemode, pig-tool-search) load from pig itself and are never copied; a stale copy of one is skipped with a warning.
Install a Package
#pig install git:github.com/user/repo # user scope; cloned under ~/.pig/agent/git/
pig install -l git:github.com/user/repo@v1 # project scope, pinned; cloned under .pig/git/
pig install ./local/path # loaded from where it is
pig remove git:github.com/user/repo
install records the source in the packages setting. pig supports git: sources, https:// and ssh:// git URLs, and local paths; npm: and composer: sources are rejected.
2. Configure Extension Paths
#Packages belong in the packages setting, which pig install maintains. Single extension files or directories can also be listed directly in the extensions setting of ~/.pig/agent/settings.json (global) or <cwd>/.pig/settings.json (project):
{
"extensions": [
"~/.pig/agent/extensions/pig-antigravity",
"~/.pig/agent/extensions/pig-computer",
"./extensions/my-custom-tool"
]
}
Or load temporarily via the command line:
pig --extension ./extensions/my-custom-tool
---
Package Structure
#A conventional pig package uses a clear, minimal directory layout:
my-pig-package/
├── index.php # Entry point returning closure function (ExtensionApi $pig): void
├── README.md # Documentation and usage
├── skills/ # (Optional) Skills bundled with this package
│ └── my-skill/
│ └── SKILL.md
└── prompts/ # (Optional) Reusable prompt templates
└── review.md
When loading, pig mounts all custom tools (registerTool), slash commands (registerCommand), and lifecycle hooks ($pig->on(...)).
---
Listing a Package in the Gallery
#pigagent.dev/packages is built from GitHub: every repository with the topic pig-package is listed, the way pi-package on npm fills pi's gallery. No registration, no review.
- One repository per package. Use the conventional directories (
extensions/,skills/,prompts/,themes/) or declare them incomposer.jsonunderextra.pig. A package that needs libraries commits its ownvendor/:pig installruns no Composer, and the loader requiresvendor/autoload.phpwhen it is there. (Onlypig update --extensionsrunscomposer update --no-dev, and only in non-git folders under~/.pig/agent/extensions/that have acomposer.json.) Do notrequirepigagent/pigin the package'scomposer.json; thePig\*classes come from the host. - Check it installs.
```bash
pig install git:github.com/user/repo # clones under ~/.pig/agent/git/github.com/user/repo
pig list # the resources it found
```
- Add the topic
pig-packageon the repository page (About → Topics). The list refreshes hourly.
The card shows the repository description, stars and last push — so the GitHub description is the card's text — plus the resource types and the install command. Removing the topic removes the package. Only GitHub is indexed; packages on other git hosts install fine but are not listed.
extra.pig may list extensions, skills, prompts, and themes paths. Two more optional fields add a preview — pig itself ignores them:
{
"extra": {
"pig": {
"extensions": ["./src/Extension.php"],
"image": "./docs/preview.png",
"video": "https://example.com/demo.mp4"
}
}
}
A relative path is read from the repository's default branch.
---
Published Packages
#Visit the pig Packages Gallery. These extensions ship in pig's own extensions/ directory:
| Package | Description | Focus |
|---|---|---|
| pig-mcp | Model Context Protocol (MCP) client (built in) | Connect external MCP servers via stdio or streamable HTTP |
| pig-codemode | PHP script sandbox in a child php process (built in) | Batch, chain, and filter tool calls in one script; only the output reaches the model |
| pig-tool-search | Search and load deferred tools (built in) | Keeps large MCP tool lists out of the model's declarations |
| pig-llama | llama.cpp router integration (built in) | Local GGUF models, /llama |
| pig-computer | Native macOS desktop control | Screenshots, mouse, keyboard, and app launching through screencapture and osascript |
| pig-antigravity | Cloud Code Assist integration with multi-account rotation | Real-time quota tracking, 429 auto-failover, image generation |
| pig-web-search | Real-time web search and content extractor | DuckDuckGo search & headless Chrome clean text extraction |
| pig-android-use | Android device control over ADB | Screenshots, taps, and input on a phone or emulator |
| pig-vless | Minimal VLESS inbound for a phone | TCP relay, one UUID, optional TLS; /vless start |
The Web UI is part of pig itself (pig --mode web, pig web start); see Web UI.