Install the osss command-line tools on macOS with MacPorts.
This is a signed ports tree served as a snapshot tarball; the ports fetch prebuilt
universal2 (Apple Silicon + Intel) binaries, so there is nothing to compile and no Rust
toolchain required.
sudo curl -fsSL https://macports.osss.net/osss-ports.pub \ -o /opt/local/share/macports/keys/ports/osss-ports.pub
MacPorts auto-loads every *.pub in that directory — no
pubkeys.conf edit needed. The snapshot tarball is signed with this
signify key and MacPorts verifies it on every sync.
Add this line to /opt/local/etc/macports/sources.conf, above the
default rsync://rsync.macports.org/… line:
https://macports.osss.net/ports.tar.gz
sudo port sync sudo port install postgres_sql_formatter
Install only what you want — each port stands alone. On the first sync MacPorts builds a local index for the tree; that is normal and happens on your machine.
pgsfpgsmpgstdpgtwtLeft is the port you install (the full project name, matching the Homebrew, FreeBSD, and Debian packaging); right is the command it provides.
sudo port sync && sudo port upgrade outdated picks up new releases as they ship — a new
version lands in the tree within moments of its release. The tree is rebuilt from each tool's latest
GitLab release automatically.
The snapshot tarball ports.tar.gz is signed with a dedicated signify key; its detached signature is at ports.tar.gz.sig and the public key at macports.osss.net/osss-ports.pub. MacPorts fetches the signature alongside the tree on every sync and refuses a tarball it cannot verify.
MacPorts base 2.12.x has a bug extracting an HTTPS tarball source: a non-verbose
sudo port sync can fail with can't read "verboseflag": no such variable
whenever it has a new tree to extract (the first sync and every upgrade). Until the fix ships,
run the sync verbosely:
sudo port -v sync
If a failed non-verbose sync already left an empty tree — subsequent syncs then report “No updates” and skip forever — clear it and re-sync verbosely:
sudo rm -rf /opt/local/var/macports/sources/macports.osss.net sudo port -v sync
This is a MacPorts base bug, not specific to this tree (it affects any HTTPS tarball source); the one-line fix is filed upstream at macports-base#417.