Flowlib
Reference

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
FlagDescription
--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 pnpm

generate

Generate Drizzle schema files from core + plugin schemas.

npx flowlib-cli generate
FlagDescription
--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-onlyGenerate schema files without migration files.
-y, --yesSkip 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
FlagDescription
--config <path>Path to config file.
--pushUse drizzle-kit push (fast, no migration files).
-y, --yesSkip confirmation prompts.

info

Display diagnostic information about your setup.

npx flowlib-cli info
FlagDescription
--config <path>Path to config file.
--jsonOutput 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 secret

Copy 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
FlagDescription
--url <url>URL of the running Flowlib API (default: http://localhost:3000/flowlib).
--api-key <key>API key for authenticated access.
--print-configOutput ready-to-paste MCP client config (e.g., for Claude Desktop).

Example: generate config for Claude Desktop

npx flowlib-cli mcp --print-config

Common workflows

Initial setup

npx flowlib-cli init

After adding a plugin with database tables

npx flowlib-cli generate
npx flowlib-cli migrate --push

Production database migration

npx flowlib-cli generate
npx flowlib-cli migrate

Generate encryption key

npx flowlib-cli secret

On this page