A TypeScript-aware CLI for Sequelize that generates TypeScript migration, model, and seed files instead of JavaScript. Version 3.2.0-c is an early release with experimental Sequelize v4 support. Unlike the standard sequelize-cli, this package introduces separate source and compiled paths for migrations (migrations-source-path and migrations-compiled-path) to accommodate TypeScript compilation. Developers must compile migrations before running db:migrate. The CLI provides commands for database creation, migration management, seeding, and model generation. Maintained by the community, it targets Node >=4.
npm install sequelize-cli-typescriptNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize project, generate a TypeScript model and migration, compile, and run migrations.
Add a compile step (e.g., tsc) to your workflow, and ensure the compiled output goes to migrations-compiled-path.
Set both paths in .sequelizerc to avoid confusion. Example: migrations-source-path: './migrations', migrations-compiled-path: './migrations-compiled'.
Use with Sequelize v3 for full support, or test thoroughly with v4.
Uninstall sequelize-cli if you intend to use sequelize-cli-typescript, or use npx to avoid global conflicts.
Reinstall locally: npm install --save sequelize-cli-typescript. Use npx sequelize to run.
Compile migrations using TypeScript compiler (tsc) and ensure output goes to migrations-compiled-path.
Install the appropriate dialect package: npm install --save pg pg-hstore (for PostgreSQL), mysql2 (for MySQL), sqlite3 (for SQLite), or tedious (for MSSQL).