PiG Documentation

Guides and references for configuring, using, and extending PiG.

Using PiG

PiG commands include top-level CLI verbs, slash commands inside the TUI, and pig docs commands for the embedded reference bundle.

CLI verbs

pig [options] [prompt]
Verb
Purpose
pigStart interactive TUI in current directory.
pig --print <prompt>One-shot: send prompt, print response, exit.
pig --model <provider/model>Override model for this run.
pig -e <path> (repeatable)Load extension at path.
pig --skill <path>Load a Skill file or directory. Repeat the option for several Skills.
pig --no-extensionsSkip all extensions; useful for isolating bugs.
pig --models <list>Comma-separated allow list of enabled models for this run.
pig --session-id <id>Use an exact session ID; may be combined with --no-session for provider cache affinity without disk persistence.
pig --mode rpcStart the JSONL RPC command loop on stdin/stdout.
pig --versionUpstream pi version pin.
pig versionDetailed pig/pi/Go/platform/build banner.
pig diagnosePrint resolved config + binary identity.

Generic subcommands

Product distributions may contribute additional top-level or nested command paths. Core command paths always win; use pig --help and the product's focused docs for contributed commands.

Subcommand
Purpose
pig login [provider]Authenticate a built-in or contributed target. Built-ins use auth.json; contributed providers may own their credential store.
pig logout [provider]Remove credentials through the same provider/store used by login and TUI /logout.
pig auth check --provider <provider> [--model <model>] [--json] [--credentials] [--no-refresh]Print ready, not_ready, or invalid and exit 0, 1, or 2. --json writes the structured result; --credentials emits the resolved credential when ready. Expired OAuth credentials are refreshed unless --no-refresh is given, which also leaves auth.json and its directory untouched.
pig auth print-api-key --provider <provider> [--model <model>]Print the resolved API key for an external client. Refuses a provider configured with OAuth.
pig auth print-bearer-token --provider <provider> [--model <model>] [--min-expiry <duration>]Print an OAuth bearer token, refreshing it when less than --min-expiry (default 30m; units ms, s, m, h) remains. Refuses a provider configured with an API key.
pig install <source>Install a package through a core or contributed resolver.
pig install <path> --validate-only [--json]Validate without installing; emits structured diagnostics.
pig install --validate-only --set "<p1>,<p2>"Validate a piglet-style extension set.
pig extension init <path> [--name <matching-name>] [--lang go\|python\|rust] [--isolated] [--force] [--json]Scaffold an extension that resolves the staged SDK offline (Go default).
pig extension preview-login <path>Start exactly one extension and render the login set during session_start; no model session starts.
pig extensions cache stats [--json]Inspect extension and runtime-cell cache classifications without changing use metadata.
pig extensions cache prune [--retention <duration>] [--max-size <bytes>] [--dry-run] [--json]Remove eligible inactive cache entries. Hard roots always remain.
pig reloadStage the embedded extension SDKs and drop extension builds an older SDK produced.
pig listList installed Packages with Pi-compatible output.
pig package list [--json]Inspect configured Package state without starting runtimes.
pig package validate <dir> [--json]Validate ordinary Package source and Resource membership without installing.
pig status [--json]Side-effect-free Package/Resource/Piglet health and canonical path overview; invalid state exits non-zero.
pig login --list [--json]List generic built-in and contributed authentication targets without reading credentials.
pig piglet list\|show\|validate\|schema\|add\|remove\|build\|keygen\|verify\|trustCurrent Piglet YAML, registration, inspection, build, and Binary-signing surface. Owned verbs use full words.
pig piglet build <name> --format script --out <path\|->Write an explicit source-bound POSIX entry script; creates no PiG state or records.
pig piglet build <name> --format binary --out <path> [--sign-key <private-key>]Build a Piglet Binary and managed v1 resolution/Binary records. The optional Ed25519 signature is checked before command dispatch.
pig piglet keygen <private-key>Create an Ed25519 private key and <private-key>.pub without replacing existing files.
pig piglet verify <binary>Verify a Piglet Binary signature offline without running it. An unsigned Binary reports unsigned and exits non-zero.
pig piglet trust [list\|add\|revoke\|require]Manage trusted and revoked signer keys and the required-signature policy.
pig piglet build <name> --format image ...Reserved Piglet Image shape; currently fails clearly because the Image producer is not implemented.
pig config [--local]Open the Resource filter TUI. Press Tab to switch global and project scope.
pig docs [sync\|path\|list\|show <name>]Materialize and read the documentation bundled with Stock PiG.

pig docs

Stock PiG materializes its reference docs into ~/.pig/docs/ so the coding agent can read the API implemented by the running binary.

pig docs              # sync + summary (default)
pig docs sync         # force re-sync
pig docs path         # print docs directory
pig docs list         # list available files
pig docs show <name>  # print one doc to stdout

EnsureSynced runs at startup. A content digest marker prevents redundant writes on warm starts and updates the materialized copy when embedded content changes.

Slash commands (TUI)

The dispatcher is exhaustive - every command here is a parity-mirrored upstream command except where noted as [pig]. Extensions may register additional slash commands via register.commands[].

Core

Command
Description
/settingsOpen the settings menu.
/modelOpen the model selector.
/thinking [level]Set the thinking level, or open the selector without a level.
/scoped-modelsEnable/disable models for Ctrl+P cycling.
/loginConfigure provider authentication.
/logoutRemove stored provider authentication.
/newStart a new session in the same cwd.
/resumeResume a different session.
/forkFork from a previous user message.
/cloneDuplicate session at the current position.
/treeNavigate session tree.
/compactManually compact the context.
/reloadReload extensions, skills, prompts, themes, keybindings.
/reload --explainSame plus a placement/cell report. [pig]
/export [path]Export session (default HTML; specify .jsonl).
/import <path>Import and resume a JSONL session.
/shareUpload an unlisted Session share that expires after 30 days.
/bug [description]Write a bug report archive to the current directory and print a prefilled PiG issue link to attach it to. Nothing is uploaded (D62).
/copyCopy the last agent message to clipboard.
/name <text>Set the session display name.
/sessionShow session info and stats.
/changelogShow changelog entries.
/hotkeysList keyboard shortcuts.
/quitExit PiG.
/trustSet the trust decision for the current project.
/llamaManage a local llama.cpp server.

There is no /exit or /clear command. Pi has neither, and PiG matches Pi. To leave, use /quit. To clear the editor, press the app.clear key (ctrl+c by default). /hotkeys lists the current bindings.

Piglet composition

Command
Description
/pigletInspect the Piglet active in this process.

PiG Standard and other Piglets can add commands through selected extension Resources. Stock PiG does not register /runner, /pig-runner, /sprite, or other product commands.

Parity harness (only when PIG_PARITY_HARNESS=1)

/probe-* family - internal scenarios used by parity/scenarios/. Not user-facing.

Keyboard shortcuts

Key
Action
EnterSubmit message.
Shift+Enter / Ctrl+JNewline in editor.
EscCancel the active dialog, compaction, Bash command, or model turn.
Ctrl+CClear the editor; press it again within 500 ms to exit.
Ctrl+DExit on empty editor.
Ctrl+P / Shift+Ctrl+PCycle to next/previous scoped model (provider-qualified).
Shift+TabCycle thinking level on reasoning-capable models.
TabAutocomplete (slash commands, paths, mentions).
Ctrl+LOpen the model selector.
Ctrl+OExpand or collapse tool output.
Ctrl+TShow or hide thinking blocks.
Ctrl+GOpen the current editor buffer in externalEditor, $VISUAL, $EDITOR, Notepad on Windows, or nano elsewhere.

Extensions may install additional shortcuts via register.shortcuts[]. The dispatcher rejects duplicates across the host and all loaded extensions.

Core-vs-extension precedence

Core commands always win. If an extension registers a slash command whose name collides with a built-in, the built-in handler runs and the extension command is suppressed with a diagnostic. The same rule applies to CLI command paths: core paths are dispatched before contributed top-level or nested paths.

Adapted from upstream Pi documentation · Upstream documentation ↗ · MIT License