CLI Reference

All dpg commands with flags and examples.

The dpg CLI is the primary interface to the DPG compiler and migration engine. All commands accept the following global flags:

FlagShortDescription
--dir-CProject root directory (default: current working directory)
--envPath to .env file (default: .env in project root, if present)

Commands

CommandDescription
dpg planDiff desired state vs snapshot and print the SQL migration
dpg applyExecute the planned migration and update the snapshot
dpg verifyCheck the live database for drift against the snapshot
dpg dumpIntrospect a live database and produce initial .dpg source files
dpg diffDiff two DPG source directories and print the SQL migration
dpg fmtFormat .dpg source files in place
dpg validateValidate .dpg source files offline without diffing
dpg portabilityReport PostgreSQL-specific constructs in use
dpg initScaffold a new DPG project
dpg completionGenerate shell autocompletion scripts
dpg docsServe the embedded documentation locally

The pages in this section are auto-generated from the CLI source via make docs-cli.