pgdesign v0.26.0 /pgdesign CLI Reference
On this page

Complete CLI reference for pgdesign — all available commands, subcommands, flags, arguments, and usage examples.

#pgdesign CLI Reference

PostgreSQL schema compiler

Version: 0.26.0

#Commands

  • build -- Generate all configured outputs from pgdesign.toml
  • check -- Run project checks registered via the check framework and report results
  • codegen -- Generate type-safe application code from schema definitions
  • diff -- Compare schema file(s) or directory against another target
  • fmt -- Format a pgdesign TOML schema file or directory in place
  • generate -- Generate SQL DDL from TOML schema file(s) or directory
  • introspect -- Introspect a live PostgreSQL database into TOML schema
  • revise -- Regenerate all outputs, chain the migration, and commit — the one-command project revision. Runs the PURE tier (build outputs, chain-mode migration, blocking normal-form and structural checks) and commits it, then runs the non-retroactive DB tier (live FD discovery, pg_stat workload).
  • seed -- Generate type-aware test data for all schema tables
  • serve -- Start the pgdesign HTTP API server and web interface
  • stats -- Analyze database statistics, index usage, and health

#Command Groups

  • import -- Pin and vendor imported schema surfaces from other pgdesign projects
  • migrate -- Database migration planning, generation, and execution
  • testdb -- Manage ephemeral test databases for schema testing

#Global flags

Global flags
NameShortTypeDefaultEnvDescription
--project-configstrPath to pgdesign.toml (bypasses directory search)

#Framework flags

These flags are owned by the strictcli framework, not by the app. No command may declare a flag with one of these names, and each is recognized anywhere on the command line.

Framework flags
FlagEffect
--dry-runPreview mode: no mutation runs. The framework prints a log of every effect the command would have performed.
--approve-consequentialSkips the confirmation prompt a consequential command shows before it runs.
--quietHides informational output. Warnings, errors, structured data and the dry-run log are never suppressed.
--verboseShows debug output. --quiet wins when both are passed.

#Infrastructure

#Connection variables

Connection variables
Env varDescription
PGDESIGN_DBPostgreSQL connection URL for database-backed commands and checks
Search