Installation
Shell (macOS/Linux):
curl -fsSL https://pgmt.dev/install.sh | shThe script installs to ~/.pgmt/bin and prints the line to add it to your
PATH if it isn’t there already. To pin a version, pass it as an argument
(sh -s -- v0.6.7); to install somewhere else, set PGMT_INSTALL.
npm:
npm install -g @pgmt/pgmtCargo (builds from source):
cargo install pgmtVerify it worked:
pgmt --versionWindows: binaries are published via npm and the install script, but not yet tested on Windows. If you try it, let us know how it goes.
Prerequisites
Section titled “Prerequisites”- PostgreSQL 13+ — a development database you can connect to.
- A container runtime — pgmt validates every change against a disposable
shadow database it runs in a container.
Docker works out of the box; Podman and other Docker-API-compatible runtimes
work too (see runtime
requirements).
If you can’t run containers at all, point
databases.shadow.urlat a dedicated empty database instead — pgmt resets it on every run, so never use a database with data you care about.
Upgrading
Section titled “Upgrading”Same commands as installing: re-run the install script, npm update -g @pgmt/pgmt, or cargo install pgmt.
Don’t cargo install in CI — that compiles pgmt from source and adds minutes
to every run. Use the GitHub Action or the install script, which fetch a
prebuilt binary:
# GitHub Actions- name: Install pgmt uses: gdpotter/pgmt@v0 # with: # version: v0.6.7 # defaults to the latest release# Anywhere else (GitLab CI, etc.)- curl -fsSL https://pgmt.dev/install.sh | sh- export PATH="$HOME/.pgmt/bin:$PATH"The GitHub Action adds pgmt to the PATH for later steps. The install script
doesn’t, so add ~/.pgmt/bin yourself as shown.
See the CI/CD guide for full pipeline examples.