app.cli-database
Command-line database tooling for ContractSpec-managed schemas and operations.
@lssm-tech/app.cli-databasebun add @lssm-tech/app.cli-databaseManifest declarations describe the current workspace; they do not verify registry publication or runtime execution.
Package guide
Website: https://contractspec.io
CLI tool for contract-source-first Drizzle/PostgreSQL database management: generate, migrate, seed, and schema operations.
What It Does
- Uses
@lssm-tech/lib.schemafor schema definitions. - Generates Drizzle/PostgreSQL artifacts from portable ContractSpec database entities.
- Commands dispatched via minimist argument parsing.
- Related ContractSpec packages include
@lssm-tech/lib.schema,@lssm-tech/tool.tsdown,@lssm-tech/tool.typescript.
Running Locally
From packages/apps/cli-database:
bun run devbun run build
Usage
npx database --help
# or
bunx database --helpArchitecture
- Uses
@lssm-tech/lib.schemafor schema definitions. - Generates Drizzle/PostgreSQL artifacts from portable ContractSpec database entities.
- Commands dispatched via minimist argument parsing.
src/cli.tsis the CLI entrypoint.src/index.tsis the root public barrel and package entrypoint.
Public Entry Points
- Binary
databasepoints todist/cli.js. - Export
.resolves through./dist/index.mjs. - Export
./cliresolves through./dist/cli.mjs. - Export
./commands/checkresolves through./dist/commands/check.mjs. - Export
./commands/generateresolves through./dist/commands/generate.mjs. - Export
./commands/importresolves through./dist/commands/import.mjs. - Export
./commands/migrateresolves through./dist/commands/migrate.mjs. - Export
./commands/schema-composeresolves through./dist/commands/schema-compose.mjs. - Export
./commands/schema-generateresolves through./dist/commands/schema-generate.mjs. - Export
./commands/seedresolves through./dist/commands/seed.mjs. - Export
./lib/configresolves through./dist/lib/config.mjs. - The package publishes 12 total export subpaths; keep docs aligned with
package.json.
Database Workflow Boundary
Prisma support is retired for supported workflows. Broad root workflows such as lint:fix, typecheck, and release checks must not run Prisma implicitly; use the explicit Drizzle/PostgreSQL packages/apps/cli-database commands below when a database schema workflow is required.
Local Commands
bun run dev— bun run build --watchbun run build— tsdownbun run lint— bun run lint:fixbun run lint:check— biome check .bun run lint:fix— biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .bun run publish:pkg— bun publish --tolerate-republish --ignore-scripts --verbosebun run publish:pkg:canary— bun publish:pkg --tag canarybun run clean— rm -rf distbun run test— standalone host test: spawnssrc/cli.tsin a throwaway project (schema generate/compose, check, Drizzle config, dry-run and refused migrations, status, seed) with no databasebun run dbs:generate— database generate --dry-runbun run dbs:migrate— database migrate:dev --dry-runbun run dbs:deploy— database migrate:deploy --dry-runbun run dbs:status— database migrate:statusbun run dbs:seed— database seed
Recent Updates
- Replace eslint+prettier by biomejs to optimize speed.
Notes
- Do not change CLI argument signatures without updating docs and CI scripts.
- Drizzle/PostgreSQL artifact generation is contract-source-first — test migrations carefully.
Relationships
Arrows point from a package to its direct dependency. Counts are derived from captured workspace manifests.
6 declarations
@lssm-tech/lib.schemaworkspace:^
Read the package manual ↗minimist^1.2.8
execa^10.0.1
@lssm-tech/lib.contracts-specworkspace:^
Read the package manual ↗drizzle-kitcatalog:data
drizzle-ormcatalog:data
Declared capabilities
This manifest does not declare a capability catalogue. Use the guide, import map and source to assess the package.
Scripts
cleanrm -rf distpublish:pkgbun publish --tolerate-republish --ignore-scripts --verbosepublish:pkg:canarybun publish:pkg --tag canarybuildbun ../../../scripts/tsdown.mjsdevbun run build --watchlintbun run lint:fixlint:fixnode ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .lint:checknode ../../../scripts/biome.cjs check .dbs:generatedatabase generate --dry-rundbs:migratedatabase migrate:dev --dry-rundbs:deploydatabase migrate:deploy --dry-rundbs:statusdatabase migrate:statusdbs:seeddatabase seed --dry-runschema:generatedatabase schema:generateschema:composedatabase schema:composetestbun test