Invect Command Line Interface

raw JSON →
0.0.11 verified Thu Apr 23 auth: no javascript

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.

error Error: Cannot find module '@invect/core' or its corresponding type declarations.
cause The `@invect/core` package, a dependency for `invect.config.ts`, is either not installed or not resolvable in the current environment.
fix
Ensure @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.
cause The `connectionString` provided in `invect.config.ts` is invalid, malformed, or the database server is inaccessible.
fix
Verify the 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.
cause The `invect-cli` command was executed in a directory without the required `invect.config.ts` file, or the file is incorrectly named/placed.
fix
Execute 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.
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.
fix Review the official documentation or changelog carefully for each update before upgrading your projects to identify and address any breaking changes.
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.
fix Prefer to rely on `invect-cli` for managing its internal dependency versions. If encountering issues, try reinstalling `invect-cli` to ensure consistent dependency resolution.
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.
fix Always run `npx invect-cli init` from your project's root to ensure the configuration file is created correctly, or manually verify its location and naming.
npm install invect-cli
yarn add invect-cli
pnpm add invect-cli

Demonstrates how to install the Invect CLI, initialize a new project interactively, and then generate database schema files based on your configuration.

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.