Invect Command Line Interface
raw JSON →Invect CLI (`invect-cli`) is a command-line interface tool designed to streamline the management of Invect workflow projects. It simplifies essential development tasks such as schema generation, database migrations, and initial project setup. Currently at version `0.0.11`, the package is in an early development stage, which implies a potentially frequent release cadence with minor version bumps that may introduce breaking changes. This CLI acts as a thin wrapper around the core `@invect/cli` package, offering an integrated experience for users. Its key functionalities include interactively initializing new projects, generating dialect-specific Drizzle schema files (supporting SQLite, PostgreSQL, and MySQL) by merging core and plugin schemas, applying database migrations, displaying diagnostic system and project information, and generating cryptographically secure encryption keys. It relies on `invect.config.ts` in the project root for configuration, facilitating seamless plugin integration and database connection management.
Common errors
error Error: Cannot find module '@invect/core' or its corresponding type declarations. ↓
@invect/core is correctly installed in your project: npm install @invect/core (or npm install -D @invect/core if only used for config). If using npx, ensure node_modules are properly accessible. error Error: Database connection failed. Please check your connectionString in invect.config.ts. ↓
connectionString format and credentials for your specific database type (SQLite, PostgreSQL, MySQL). Check server status, network access, and correct file paths for SQLite databases. error Error: `invect.config.ts` not found in project root. Run `invect-cli init` to create one. ↓
npx invect-cli init from your project's root directory to generate the invect.config.ts file, or confirm it is present and correctly named in the root. Warnings
breaking As a package in early development (version `0.0.x`), `invect-cli` may introduce breaking changes in minor or even patch releases. Ensure thorough testing when updating. ↓
gotcha This package is a 'thin wrapper' around `@invect/cli`. While `invect-cli` typically manages its underlying dependencies, unexpected behavior might occur if you manually install or update `@invect/cli` or `@invect/core` to incompatible versions. ↓
gotcha The `invect.config.ts` file must be present in your project's root directory for `invect-cli` commands to execute correctly. Misplacement or incorrect naming will lead to configuration errors. ↓
Install
npm install invect-cli yarn add invect-cli pnpm add invect-cli Imports
- defineConfig
import { defineConfig } from '@invect/core';
Quickstart
npm install -D invect-cli
npx invect-cli init
# Follow the interactive prompts to set up your project,
# including framework detection, dependency installation,
# invect.config.ts creation, initial schema generation, and migration.
npx invect-cli generate
# Generates Drizzle schema files for configured database dialects.