Skip to main content

Installation

npm install @workflow/cli
Or install globally:
npm install -g @workflow/cli

Usage

The CLI provides two commands:
workflow [command]
Or using the short alias:
wf [command]

Available Commands

  • build - Build workflow bundles for deployment
  • dev - Start development server with file watching (Coming soon)
Use workflow --help to see all available commands.

Global Flags

--help

Show help for any command:
workflow --help
workflow build --help

--json

Output results in JSON format (available on all commands):
workflow build --json

Command Overview

Build

Build workflow bundles for deployment:
workflow build --target standalone
See workflow build for details.

Dev (Coming Soon)

Start development server:
workflow dev --port 3000
See workflow dev for details.

Package Information

  • Package: @workflow/cli
  • Binary: workflow, wf
  • Framework: oclif

Exit Behavior

All commands properly clean up resources before exiting:
  1. Closes cached World instance
  2. Cleans up database connections
  3. Closes HTTP agents
  4. Exits with appropriate code (0 for success, 1 for error)

Error Handling

Errors are displayed with clear messages:
$ workflow build --target invalid

Invalid target "invalid". Using default "standalone".
Valid targets: standalone, vercel-build-output-api

Environment Variables

The CLI respects various environment variables for configuration. These are typically set by framework integrations or deployment platforms. Common variables:
  • NODE_ENV - Development or production mode
  • VERCEL_DEPLOYMENT_ID - Vercel deployment detection
  • WORKFLOW_TARGET_WORLD - World target (local, vercel, etc.)

Logging

Commands provide informative logging:
  • Info: General information about progress
  • Warn: Warnings about deprecated features or invalid options
  • Error: Error messages with details
Example output:
$ workflow build

Using target: standalone
Building with StandaloneBuilder
Build completed successfully!

Build docs developers (and LLMs) love