CMD Docs
pig manages PostgreSQL packages, local database services, and Pigsty deployments. Choose a command below for your task. Use pig COMMAND --help to see the options supported by your installed program.
- pig repo: manage software repositories
- pig ext: manage PostgreSQL extensions
- pig build: build extensions from source
- pig install: install packages with the native package manager and translate PostgreSQL aliases
- pig sty: manage Pigsty installation and Grafana dashboards
- pig inventory: inspect, edit, validate, and exchange the Pigsty inventory
- pig do: run Pigsty administration playbook tasks
- pig pe: access pg_exporter metrics and configuration
- pig pg: manage local PostgreSQL servers
- pig pt: run patronictl transparently with service and config helpers
- pig pb: manage pgBackRest backup and restore
- pig pitr: run the full PITR workflow
- pig context: output an environment context snapshot for humans and agents
- pig license: issue and verify Pigsty licenses
- pig status / update / version: inspect environment status, upgrade pig, and print version information
Global options
| Option | Purpose |
|---|---|
-h, --help |
Show help |
-H, --home PATH |
Select the Pigsty installation directory |
-i, --inventory PATH |
Select the inventory |
-o, --output FORMAT |
Output format: text (default), json, yaml, or json-pretty |
--debug |
Enable debug logging |
--log-level LEVEL |
Log level: debug, info (default), warn, error, fatal, or panic |
--log-path PATH |
Write logs to a file; the default is the terminal |
PIG-owned results support structured output. Raw-content commands such as inventory show and passthrough commands such as pt list retain their native output. See the command reference for details.
Structured results keep diagnostics and wrapped-tool chatter on stderr. JSON/YAML output andPIG_NON_INTERACTIVE=1 disable prompt input in PIG-owned command adapters and use sudo -n;
they do not supply destructive-operation confirmation. Pass --yes where required.
Documented data input, such as pig pg psql -f -, remains available. Native Patronictl
forwarding retains its own interaction and output contract and rejects PIG structured-output modes.
pig repo
Manage APT/YUM repositories for PostgreSQL packages. See pig repo for details.
pig ext
Manage PostgreSQL extensions and kernel packages. See pig ext for details.
pig build
Build PostgreSQL extensions from source. See pig build for details.
pig install
Install packages through the system’s native package manager and translate PostgreSQL kernel, extension, and common aliases into package names. Use -n/--no-translation when you need to pass raw system package names directly.
pig sty
Install the Pigsty distribution. See pig sty for details.
pig inventory
Inspect, edit, validate, check, and exchange the Pigsty inventory (pigsty.yml) with the
CMDB. Root-level command group with alias inv; see pig inventory
for details.
pig do
Run Pigsty administration tasks through the corresponding Ansible playbooks. Seepig do for the command reference.
pig pe
Access PostgreSQL monitoring metrics exposed by pg_exporter. The default endpoint is127.0.0.1:9630; see pig pe for endpoint and operation details.
pig license
pig license issue <name> delivers the newly issued license to its caller. Text output includes
the token; JSON/YAML preserve it in data.captured_output. Successful issuance is an explicit
credential-delivery operation, so that result must be stored as a credential. The signing key is
never included in arguments, parameters, or diagnostics returned in the result. Raw key-loading
errors are replaced with fixed messages. Parameter errors and safe signing-key failure reasons
remain available in text, JSON, and YAML. license status and license verify do not reveal tokens.
pig context
Output an environment context snapshot covering host, PostgreSQL, Patroni, pgBackRest, and installed extensions. This command is useful for troubleshooting and for automation scripts that need a quick view of the current node.
pig pg
Manage the local PostgreSQL server. See pig pg for details.
pig pt
Run patronictl transparently to manage Patroni HA clusters. See pig pt for details.
pig pb
Manage pgBackRest backup and restore. See pig pb for details.
pig pitr
Run orchestrated point-in-time recovery (PITR). See pig pitr for details.
Helper Commands
pig update uses the native package manager on supported Linux distributions. On macOS,
download the new archive and replace the executable as described in Installation.
If ~/.pig/config.yml has a syntax error, fix it before running commands that read configuration, such as pig status. pig version and the pig pe HTTP commands remain available because they do not read this file.
Design records
- From Human-Friendly to Agent-Native
- Why PIG Keeps the Cobra Command Layer Flat
- PIG’s Operations CLI Safety Contract
How to manage repositories with pig repo subcommand?
How to manage extensions with pig ext subcommand
Run Pigsty administration tasks with pig do
How to manage pigsty with pig sty subcommand
How to setup building infrastructure with pig build subcommand?
Inspect, edit, validate, check, and exchange the Pigsty Inventory
Manage local PostgreSQL server with pig pg subcommand
Run patronictl transparently with Pigsty service and config helpers
Manage pgBackRest backup and PITR with pig pb subcommand
Read PostgreSQL metrics and reload pg_exporter configuration
Perform orchestrated Point-In-Time Recovery with pig pitr command