{"id":18756,"library":"rhinozug-cli","title":"Rhinozug CLI","description":"A database migration CLI tool built by Rhinogram for managing PostgreSQL schema changes programmatically. Version 0.1.9 is the latest stable release; release cadence is irregular. It wraps Knex.js to provide an opinionated migration workflow with 'up' and 'down' commands, timestamped migration files, and custom templates. Unlike standalone tools like Knex CLI, Rhinozug is designed as a global npm package and uses a project-local initialization (`rz init`) to create config and migration directories. It is intended primarily for Rhinogram's internal use, but is publicly available on npm.","status":"active","version":"0.1.9","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install rhinozug-cli","lang":"bash","label":"npm"},{"cmd":"yarn add rhinozug-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add rhinozug-cli","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The CLI is installed globally; use 'npx rhinozug-cli' to run commands without global install.","wrong":"npm run rz init","symbol":"rz init","correct":"npx rhinozug-cli init"},{"note":"Migration names are used as filenames; avoid hyphens or special characters.","wrong":"rz create:migration my-migration","symbol":"rz create:migration","correct":"rz create:migration my_migration"},{"note":"There is no 'migrate' subcommand; use 'up' and 'down' directly.","wrong":"rz migrate:up","symbol":"rz up","correct":"rz up"},{"note":"Use -t (not --target) and specify the full migration filename.","wrong":"rz down --target migration.js","symbol":"rz down","correct":"rz down -t 20220314120000_migration.js"}],"quickstart":{"code":"npm install -g rhinozug-cli\nmkdir my-project && cd my-project\nnpm init -y\nrz init\nrz create:migration add_users_table\n# Edit migrations/20220314120000_add_users_table.js:\n# exports.up = (knex) => knex.schema.createTable('users', (t) => { t.increments(); t.string('name'); });\n# exports.down = (knex) => knex.schema.dropTable('users');\nrz up\nrz list:m\n","lang":"javascript","description":"Demonstrates installing globally, initializing a project, creating a migration, running it, and listing migration status."},"warnings":[{"fix":"Use 'rhinozug' instead of 'rz' or check for existing 'rz' command.","message":"The 'rz' alias may conflict with other tools that use 'rz' command.","severity":"gotcha","affected_versions":"all"},{"fix":"Always test 'rz down' immediately after 'rz up' to ensure database state is restored.","message":"Migrations must be idempotent: the 'down' must exactly undo the 'up'.","severity":"gotcha","affected_versions":"all"},{"fix":"Run 'npm init -y' before 'rz init'.","message":"If the project does not have a package.json, 'rz init' will fail.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the exact migration filename as shown in 'rz list:m'.","message":"The target file in 'rz up -t' must be the full filename including timestamp.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install -g rhinozug-cli' or use 'npx rhinozug-cli <command>'.","cause":"The package is not installed globally or you are not using npx.","error":"Error: Cannot find module 'rhinozug-cli'"},{"fix":"Install globally: 'npm install -g rhinozug-cli'. Check PATH or call 'npx rhinozug-cli'.","cause":"The global bin path is not in your PATH or the package was not installed globally.","error":"rz: command not found"},{"fix":"Run 'rz init' from the project root.","cause":"'rz init' has not been run in the current project.","error":"Error: ENOENT: no such file or directory, open 'config/migration.template'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}