Registry / database / pgmcli

pgmcli

JSON →
library3.1.0jsnpmunverified

A command-line tool to manage Postgres migrations. Current stable version is 3.1.0, released as part of a monorepo with active development. It provides a simple CLI for creating, running, and reverting database migrations. Differentiators include minimal configuration, support for both SQL and JavaScript/TypeScript migration files, and integration with the pg npm package. Alternative tools like node-pg-migrate or knex have different APIs.

npm install pgmcli
INSTALL
IMPORT
SIG · PGMCLI
P
pgmcli
databasejavascriptv3.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pgmcli
npx pgmcli migrate up
pgmcli migrate:up
CLI commands use spaces, not colons.
pgmcli
pgmcli init
pgmcli --init
Use 'init' subcommand, not --init flag.
pgmcli
pgmcli migrate down --all
pgmcli rollback
Use 'migrate down' to revert, not 'rollback'.

Initialize migration tool, create a new migration file, apply all pending migrations, and check status.

npx pgmcli init npx pgmcli migrate create my_migration npx pgmcli migrate up npx pgmcli status
Debug
Known issues
breakingv3 drops support for Node.js <18 and uses ESM-only exports.
fix
Ensure Node.js >=18 and use ESM-compatible require/import.
affects: >=3.0.0
deprecatedThe 'rollback' command was deprecated in v2.5.0 and removed in v3.0.0. Use 'migrate down' instead.
fix
Replace 'rollback' with 'migrate down'.
affects: >=2.5.0 <3.0.0
gotchaMigration files must be placed in a 'migrations' directory by default. Custom paths require '--migrations-dir' flag.
fix
Create a 'migrations' folder or specify path with --migrations-dir.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'pg'
The 'pg' package is not installed as a peer dependency.
fix
Run 'npm install pg --save' to install the required PostgreSQL client.
Error: ENOENT: no such file or directory, open 'migrations/...'
Migration directory doesn't exist.
fix
Run 'pgmcli init' to create the migrations directory and configuration.
Command not found: pgmcli
pgmcli is not installed globally or in PATH.
fix
Use 'npx pgmcli' or install globally with 'npm install -g pgmcli'.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies
pgrequiredPostgreSQL client for executing migrations
commanderrequiredCLI argument parsing
Agent activity
2 hits · last 30 days
node
2
Resources
packagepgmcli
pgmcli — npm install pgmcli · libregistry