Engrave CLI Documentation

## Overview

Engrave is a static site generator with live preview capability. It provides a CLI interface for building static HTML sites from templates and serving them with a development server that features live previews.

The CLI offers three main commands:

- `build` - Build static HTML files from templates
- `serve` - Start a development server with live preview
- `version` - Display the version of Engrave

## Build Command

engrave build

Build static HTML files from templates.

### Arguments

src_dir Required

Source directory containing templates. This directory must exist and be a directory, not a file.

dest_dir Required

Destination directory for built HTML files. The directory will be created if it doesn't exist.

### Options

--asset, -a Optional

Asset regex pattern to copy. Default: None

--exclude, -e Optional

Glob patterns to exclude. This option can be used multiple times to specify multiple patterns.

Default: ["**/*.layout.html"] is always included in the exclusion list.

--workers, -w Optional

Maximum number of worker threads. Default: None (system decides)

--log, -l Optional

Set Log Level (DEBUG, INFO, WARNING, ERROR, CRITICAL). Default: INFO

## Serve Command

engrave serve

Start a development server with live preview.

### Arguments

template_dir Required

Directory containing templates. This directory must exist and be a directory, not a file.

### Options

--host, -h Optional

Host to bind the server to. Default: 127.0.0.1

--port, -p Optional

Port to bind the server to. Default: 8000

--log, -l Optional

Set Log Level (DEBUG, INFO, WARNING, ERROR, CRITICAL). Default: INFO

## Version Command

engrave version

Display the version of Engrave.

This command has no arguments or options.

## Examples

### Build Command Examples

    engrave build ./templates ./output

Build static HTML files from templates in ./templates directory into ./output directory.

    engrave build ./templates ./output --asset ".*\\.(css|js|png|jpg|svg)$" --exclude "**/_drafts/*.html" -w 4

Build static HTML files with specified asset regex pattern, excluding drafts, using 4 worker threads.

### Serve Command Examples

    engrave serve ./templates

Start a development server for the ./templates directory with the default host and port.

    engrave serve ./templates --host 0.0.0.0 --port 3000 --log DEBUG

Start a development server that binds to all interfaces on port 3000 with DEBUG level logging.

### Version Command Example

    engrave version

Display the current version of Engrave.

↑