CLI
All commands, flags, and examples for the Flowlib CLI.
The Flowlib CLI (flowlib-cli) manages project initialisation, schema generation, and database migrations. It's the recommended way to set up and manage your Flowlib project.
npx flowlib-cli <command> [options]You can also use your package manager's equivalent: pnpm dlx flowlib-cli, yarn dlx flowlib-cli, or bunx flowlib-cli.
All commands accept --debug for detailed error output and stack traces.
init
Interactive setup wizard. Detects framework, installs dependencies, creates config, generates schemas, runs initial migration. This is the recommended way to get started.
npx flowlib-cli init| Flag | Description |
|---|---|
--framework <name> | Skip framework detection (express, nestjs, nextjs). |
--database <type> | Skip database selection (sqlite, postgresql, mysql). |
--package-manager <pm> | Skip package manager detection (npm, pnpm, yarn, bun). |
Example: non-interactive setup
npx flowlib-cli init --framework express --database sqlite --package-manager pnpmgenerate
Generate Drizzle schema files from core + plugin schemas.
npx flowlib-cli generate| Flag | Description |
|---|---|
--config <path> | Path to config file (default: auto-discovery). |
--dialects <list> | Comma-separated dialects (sqlite, postgresql, mysql). |
--out-dir <dir> | Output directory for generated files. |
--adapter <name> | Schema adapter (drizzle or prisma). |
--schema-only | Generate schema files without migration files. |
-y, --yes | Skip confirmation prompts. |
The CLI reads flowlib.config.ts, discovers plugins, merges schemas, and generates dialect-specific Drizzle files. Unchanged files are skipped.
Run this after adding or updating plugins with database tables.
migrate
Apply database schema changes.
# Production: generate + apply migration files
npx flowlib-cli migrate
# Development: push schema directly (fast, no migration files)
npx flowlib-cli migrate --push| Flag | Description |
|---|---|
--config <path> | Path to config file. |
--push | Use drizzle-kit push (fast, no migration files). |
-y, --yes | Skip confirmation prompts. |
info
Display diagnostic information about your setup.
npx flowlib-cli info| Flag | Description |
|---|---|
--config <path> | Path to config file. |
--json | Output as JSON. |
Shows system info, detected framework, database type, config location, installed packages, and registered plugins.
secret
Generate a cryptographically secure 32-byte base64 encryption key for FLOWLIB_ENCRYPTION_KEY.
npx flowlib-cli secretCopy the output into your .env file or secrets manager.
mcp
Start a Model Context Protocol (MCP) server over stdio. Connects to a running Flowlib instance and exposes flow building/execution tools to AI assistants like Claude, Copilot, or Cursor.
npx flowlib-cli mcp --url http://localhost:3000/flowlib| Flag | Description |
|---|---|
--url <url> | URL of the running Flowlib API (default: http://localhost:3000/flowlib). |
--api-key <key> | API key for authenticated access. |
--print-config | Output ready-to-paste MCP client config (e.g., for Claude Desktop). |
Example: generate config for Claude Desktop
npx flowlib-cli mcp --print-configCommon workflows
Initial setup
npx flowlib-cli initAfter adding a plugin with database tables
npx flowlib-cli generate
npx flowlib-cli migrate --pushProduction database migration
npx flowlib-cli generate
npx flowlib-cli migrateGenerate encryption key
npx flowlib-cli secret