CLI Reference
The nwb (Next Workflow Builder) CLI provides commands for plugin management and database operations.
Installation
The CLI is included with the next-workflow-builder package. It’s available as:
npx nwb <command>Or add scripts to your package.json:
{
"scripts": {
"discover-plugins": "nwb discover-plugins",
"create-plugin": "nwb create-plugin",
"db:migrate:prod": "nwb migrate-prod"
}
}Commands
nwb discover-plugins
Scans the plugins/ directory and generates all registry files.
npx nwb discover-pluginsWhat it does:
- Scaffolds
plugins/index.tsif it doesn’t exist (never overwrites an existing file) - Imports
plugins/index.tsto populate the integration registry (both local and npm plugins) - Generates the following files:
lib/types/integration.ts- Union type of all integration type slugslib/step-registry.ts- Maps action IDs to lazy step import functionslib/output-display-configs.ts- Maps action IDs to display configurationslib/codegen-registry.ts- Code generation templates
When to run:
- Before
next devandnext build(recommended in your scripts) - After modifying a plugin’s actions, routes, or output configs
- Not needed just for adding/removing plugins — edit
plugins/index.tsdirectly
Typical setup:
{
"scripts": {
"dev": "nwb discover-plugins && next dev",
"build": "nwb discover-plugins && next build"
}
}nwb create-plugin
Interactive scaffolding tool to create a new plugin from templates.
npx nwb create-pluginPrompts you for:
- Plugin name / slug
- Display label
- Description
- Initial actions
Creates a complete plugin directory with all required files.
nwb migrate-prod
Run database migrations for production deployments (e.g. on Vercel).
npx nwb migrate-prodReads the database URL from DATABASE_URL and applies any pending schema migrations.
Help
npx nwb --helpLast updated on