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 |
pig | Start 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-extensions | Skip 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 rpc | Start the JSONL RPC command loop on stdin/stdout. |
pig --version | Upstream pi version pin. |
pig version | Detailed pig/pi/Go/platform/build banner. |
pig diagnose | Print 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 reload | Stage the embedded extension SDKs and drop extension builds an older SDK produced. |
pig list | List 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\|trust | Current 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 stdoutEnsureSynced 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 |
/settings | Open the settings menu. |
/model | Open the model selector. |
/thinking [level] | Set the thinking level, or open the selector without a level. |
/scoped-models | Enable/disable models for Ctrl+P cycling. |
/login | Configure provider authentication. |
/logout | Remove stored provider authentication. |
/new | Start a new session in the same cwd. |
/resume | Resume a different session. |
/fork | Fork from a previous user message. |
/clone | Duplicate session at the current position. |
/tree | Navigate session tree. |
/compact | Manually compact the context. |
/reload | Reload extensions, skills, prompts, themes, keybindings. |
/reload --explain | Same plus a placement/cell report. [pig] |
/export [path] | Export session (default HTML; specify .jsonl). |
/import <path> | Import and resume a JSONL session. |
/share | Upload 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). |
/copy | Copy the last agent message to clipboard. |
/name <text> | Set the session display name. |
/session | Show session info and stats. |
/changelog | Show changelog entries. |
/hotkeys | List keyboard shortcuts. |
/quit | Exit PiG. |
/trust | Set the trust decision for the current project. |
/llama | Manage 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 |
/piglet | Inspect 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 |
Enter | Submit message. |
Shift+Enter / Ctrl+J | Newline in editor. |
Esc | Cancel the active dialog, compaction, Bash command, or model turn. |
Ctrl+C | Clear the editor; press it again within 500 ms to exit. |
Ctrl+D | Exit on empty editor. |
Ctrl+P / Shift+Ctrl+P | Cycle to next/previous scoped model (provider-qualified). |
Shift+Tab | Cycle thinking level on reasoning-capable models. |
Tab | Autocomplete (slash commands, paths, mentions). |
Ctrl+L | Open the model selector. |
Ctrl+O | Expand or collapse tool output. |
Ctrl+T | Show or hide thinking blocks. |
Ctrl+G | Open 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.