@tenora/cli
v0.2.1
Published
Standalone Tenora CLI
Maintainers
Readme
@tenora/cli
Standalone Tenora CLI package.
@tenora/cli provides the tenora command so users can run migrations/seeds and tenant-wide DB operations without relying on a specific runtime package install layout.
Why @tenora/cli?
- Install globally and run
tenoraanywhere. - Install project-local and run via
npx tenora. - Keep CLI concerns separate from application runtime code.
Installation
Global install:
npm install -g @tenora/cliProject-local install:
npm install -D @tenora/cli
npx tenora listCommands
tenora migrate(aliasmigrate:base)tenora rollback(aliasrollback:base)tenora migrate:tenantstenora rollback:tenantstenora make:migration <name>(aliasmake:migration:base)tenora make:migration:tenants <name>tenora make:seed <name>(aliasmake:seed:base)tenora make:seed:tenants <name>tenora seed:run(aliasseed:run:base)tenora seed:run:tenantstenora list
Common options
-c, --config <path>: explicit config file path.--create-base: create the base DB if it does not exist.--esm/--cjs: template module format override formake:migration*andmake:seed*.
Config lookup
If --config is not set, CLI checks this order from current working directory:
tenora.config.jstenora.config.mjstenora.config.ts
You can also set TENORA_CONFIG.
Example workflow
# Create base DB if needed and run base migrations
tenora migrate --create-base
# Run tenant migrations for all tenants in registry
tenora migrate:tenants
# Generate a tenant migration template
tenora make:migration:tenants add_status_to_invoices
# Run tenant seeds
tenora seed:run:tenantsNotes
- Registry migration is auto-generated if missing when running base migrate.
make:migration:*requires configured migrations directories.make:seed:*andseed:run*require configured seed directories.- Template output defaults to nearest
package.jsonmodule type unless overridden. - For global CLI installs, keep your DB driver in the target project (for example
pg,mysql2,mariadb,sqlite3, ormssql).
Relationship to other packages
- Depends on
@tenora/corefor shared CLI + factory internals. - Can be installed and used independently by end users.
