# CLI reference

Source: https://twiki.twango.dev/reference/cli

# CLI reference

<!-- Generated by bun run docs:generate. Edit the source definitions, not this page. -->

Generated from [the actual command definitions](https://github.com/twangodev/twiki/blob/main/cli/commands.ts). This reference follows the checked-out engine source.

Run `twiki --help` or `twiki <command> --help` for terminal help. Use `--project <directory>` and `--config <file>` to select a vault.

## dev

Start the development server

```text
Usage: twiki dev [options]

Start the development server

Options:
  --project <directory>  Consumer root (default: current directory)
  --config <file>        Explicit JSON configuration
  -h, --help             display help for command
```

## check

Check types, links, targets, and diagrams

```text
Usage: twiki check [options]

Check types, links, targets, and diagrams

Options:
  --project <directory>  Consumer root (default: current directory)
  --config <file>        Explicit JSON configuration
  -h, --help             display help for command
```

## build

Build a Cloudflare Worker or export public static pages

```text
Usage: twiki build [options]

Build a Cloudflare Worker or export public static pages

Options:
  --project <directory>  Consumer root (default: current directory)
  --config <file>        Explicit JSON configuration
  --target <target>      Output target (choices: "cloudflare", "static",
                         default: "cloudflare")
  -h, --help             display help for command
```

## preview

Preview the Cloudflare build locally

```text
Usage: twiki preview [options]

Preview the Cloudflare build locally

Options:
  --project <directory>  Consumer root (default: current directory)
  --config <file>        Explicit JSON configuration
  -h, --help             display help for command
```

## deploy

Upload an existing Cloudflare build

```text
Usage: twiki deploy [options]

Upload an existing Cloudflare build

Options:
  --project <directory>  Consumer root (default: current directory)
  --config <file>        Explicit JSON configuration
  -h, --help             display help for command
```

## prepare

Prepare the consumer-owned .twiki/site runtime

```text
Usage: twiki prepare [options]

Prepare the consumer-owned .twiki/site runtime

Options:
  --project <directory>  Consumer root (default: current directory)
  --config <file>        Explicit JSON configuration
  --json                 Print resolved runtime paths as JSON
  -h, --help             display help for command
```

## exec

Run Bun tooling in the prepared runtime

```text
Usage: twiki exec [options]

Run Bun tooling in the prepared runtime

Options:
  --project <directory>  Consumer root (default: current directory)
  --config <file>        Explicit JSON configuration
  -h, --help             display help for command
```

## init

Create twiki.config.json without overwriting an existing file

```text
Usage: twiki init [options]

Create twiki.config.json without overwriting an existing file

Options:
  --project <directory>  Consumer root (default: current directory)
  --config <file>        Explicit JSON configuration
  -h, --help             display help for command
```

See [[getting-started/index|Getting started]] and [[reference/configuration|Configuration reference]].
