Global Options
These options are available for all commands.Display help information for the CLI or a specific command.Aliases:
-hDisplay version information.Aliases:
-VExamples
Show general help:compile Options
Options specific to thecompile command.
Specify the output file path for the generated SVG.Aliases:
-oDefault behavior: When not specified, outputs to stdout, which allows piping to other commands.Override the output width in pixels.Aliases:
-wDefault behavior:- For self-contained documents: Uses width from
metafield if not overridden - For bare elements: Defaults to 800 pixels
- CLI flag takes precedence over document metadata
Format the SVG output with indentation and line breaks for human readability.Default behavior: Outputs minified SVG without extra whitespace.
Option Interactions
Width precedence: The--width flag overrides the width specified in document metadata:
--output, progress information is written to stderr:
Examples
Combine multiple options:Default Values Summary
| Option | Default | Applies To | Notes |
|---|---|---|---|
--output | stdout | compile | Writes to stderr when file path is specified |
--width | 800 | compile | For bare elements; self-contained docs use meta.width |
--pretty | false | compile | Minified output by default |
Exit Codes
The HTVG CLI uses standard exit codes:| Code | Meaning | Example |
|---|---|---|
| 0 | Success | Compilation completed without errors |
| 1 | Error | File not found, invalid JSON, compilation failure |