> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/vercel/workflow/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Overview

> Command-line interface for Workflow DevKit

## Installation

```bash theme={null}
npm install @workflow/cli
```

Or install globally:

```bash theme={null}
npm install -g @workflow/cli
```

## Usage

The CLI provides two commands:

```bash theme={null}
workflow [command]
```

Or using the short alias:

```bash theme={null}
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:

```bash theme={null}
workflow --help
workflow build --help
```

### `--json`

Output results in JSON format (available on all commands):

```bash theme={null}
workflow build --json
```

## Command Overview

### Build

Build workflow bundles for deployment:

```bash theme={null}
workflow build --target standalone
```

See [workflow build](/api-reference/cli/build) for details.

### Dev (Coming Soon)

Start development server:

```bash theme={null}
workflow dev --port 3000
```

See [workflow dev](/api-reference/cli/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:

```bash theme={null}
$ 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:

```bash theme={null}
$ workflow build

Using target: standalone
Building with StandaloneBuilder
Build completed successfully!
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.