Rhinox.Cli
0.0.41-alpha
dotnet tool install --global Rhinox.Cli --version 0.0.41-alpha
dotnet new tool-manifest
dotnet tool install --local Rhinox.Cli --version 0.0.41-alpha
#tool dotnet:?package=Rhinox.Cli&version=0.0.41-alpha&prerelease
nuke :add-package Rhinox.Cli --version 0.0.41-alpha
Rhinox.Cli
A .NET global tool for managing PostgreSQL schema migrations with Rhinox.
Install
dotnet tool install --global Rhinox.Cli
Commands
rhinox introspect
Connect to an existing PostgreSQL database and write db/schema/*.sql files describing its current state. Use this once when adopting Rhinox on an existing database; commit the generated files and let the source generator drive code generation from them on subsequent builds.
rhinox introspect --connection "Host=localhost;Database=mydb;Username=postgres;Password=secret" --schema-dir db/schema --schemas public
Pass multiple schemas as a comma-separated list, e.g. --schemas public,inventory.
rhinox migrate plan
Preview pending schema changes without writing any files.
rhinox migrate plan --schema-dir db/schema --migrations-dir db/migrations
rhinox migrate generate
Generate a migration SQL file from detected schema changes.
rhinox migrate generate --schema-dir db/schema --migrations-dir db/migrations --name "add_user_phone"
rhinox migrate apply
Apply pending migrations to a PostgreSQL database. Uses a PostgreSQL advisory lock to prevent concurrent applies.
rhinox migrate apply --connection "Host=localhost;Database=mydb;Username=postgres;Password=secret" --migrations-dir db/migrations
Apply up to a specific migration:
rhinox migrate apply --connection "..." --migrations-dir db/migrations --target "20260319"
rhinox migrate status
Show which migrations have been applied and which are pending.
rhinox migrate status --connection "Host=localhost;Database=mydb;Username=postgres;Password=secret" --migrations-dir db/migrations
Options
| Option | Description | Default |
|---|---|---|
--connection |
PostgreSQL connection string (required for introspect/apply/status) |
— |
--schema-dir |
Directory containing schema definition files | db/schema |
--schemas |
Comma-separated PostgreSQL schemas to introspect (for introspect) |
public |
--migrations-dir |
Directory containing migration SQL files | db/migrations |
--name |
Custom migration name (for plan/generate) |
auto-generated |
--target |
Apply up to a specific migration prefix (for apply) |
all pending |
How it works
- (First-time only, on existing databases) Run
rhinox introspectto dump the current state intodb/schema/*.sql - Define / evolve your schema in
.sqlfiles underdb/schema/ - Run
rhinox migrate generateto diff the schema against existing migrations and produce a new migration file - Review the generated SQL — destructive operations are marked with
-- DESTRUCTIVE - Run
rhinox migrate applyto execute pending migrations inside transactions with checksum verification
Migrations are tracked in a _rhinox_migrations table created automatically in your database.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.41-alpha | 442 | 5/14/2026 |
| 0.0.40-alpha | 62 | 5/14/2026 |
| 0.0.39-alpha | 64 | 5/13/2026 |
| 0.0.38-alpha | 65 | 5/13/2026 |
| 0.0.37-alpha | 61 | 5/5/2026 |
| 0.0.36-alpha | 56 | 5/5/2026 |
| 0.0.35-alpha | 52 | 5/5/2026 |
| 0.0.34-alpha | 57 | 5/4/2026 |
| 0.0.33-alpha | 86 | 5/4/2026 |
| 0.0.31-alpha | 71 | 5/1/2026 |
| 0.0.30-alpha | 111 | 4/18/2026 |
| 0.0.29-alpha | 76 | 4/18/2026 |
| 0.0.28-alpha | 83 | 4/13/2026 |
| 0.0.27-alpha | 84 | 4/12/2026 |
| 0.0.26-alpha | 74 | 4/11/2026 |
| 0.0.24-alpha | 73 | 4/9/2026 |
| 0.0.23-alpha | 68 | 4/9/2026 |
| 0.0.19-alpha | 78 | 3/23/2026 |
| 0.0.18-alpha | 65 | 3/23/2026 |
| 0.0.17-alpha | 115 | 3/23/2026 |