dft render¶
Render a face to SVG, HTML, PNG, PDF, JSON, YAML, or terminal output.
Use "-" as the FACE argument to read YAML from stdin — useful for AI agents and shell pipelines that don't want to write a temp file.
Arguments¶
| Argument | Description |
|---|---|
FACE |
Path to face YAML file, or "-" to read YAML from stdin. (required) |
Options¶
| Flag | Description |
|---|---|
--output PATH |
Output file path. Default: face name with extension. Use "-" to write to stdout. |
--format TEXT |
Output format: svg, html, png, pdf, terminal, json, text, yaml. Default: svg. |
--project-dir PATH |
Project directory for resolving relative paths. |
--var KEY=VALUE |
Variable value (repeatable). |
--no-cache |
Bypass all query caches and re-run from scratch. |
--json-errors |
Emit errors as JSON to stdout instead of Rich panels. Success-path output is still controlled by --format. |
Output formats¶
| Format | Purpose |
|---|---|
svg (default) |
Scalable vector graphics — embedding, presentations |
html |
Interactive HTML page with embedded charts |
png |
Raster image — screenshots, thumbnails |
pdf |
PDF document — reports, printing |
terminal |
ASCII/Unicode charts printed to stdout |
json |
Post-execution resolved layout + data |
text |
Plain text rendering |
yaml |
Compiled face YAML |
Examples¶
Static export¶
dft render faces/sales.yml # → faces/sales.svg
dft render faces/sales.yml --format html
dft render faces/sales.yml --format png
dft render faces/sales.yml --format pdf
dft render faces/sales.yml --output sales.svg
Variables¶
Terminal preview¶
================================================================================
Sales Dashboard
================================================================================
Daily Revenue Trend
┌────────────────────────────────────────────────────────────┐
2400.0┤ ▗ ▟ ▗ │
2141.7┤ ▄▀▖ ▞ ▚ ▞▖ ▄▀▖ │
...
Terminal format writes directly to stdout. Use shell redirection to save:
Reading YAML from stdin¶
dft render - --format terminal --project-dir . <<'EOF'
charts:
revenue:
query:
type: csv
file: data/sales.csv
type: bar
x: region
y: revenue
rows:
- revenue
EOF
--project-dir controls where relative file paths (CSVs, etc.) are resolved from when reading stdin. Defaults to cwd.
CI artifact generation¶
for face in faces/*.yml; do
dft render "$face" \
--format html \
--output "dist/$(basename "$face" .yml).html"
done
Inspect resolved layout for debugging¶
Caching¶
By default, dft render reuses cached query results. Pass --no-cache to force re-execution from scratch.
Error output¶
For programmatic consumers (agents, CI), --json-errors emits machine-readable errors to stdout instead of formatted Rich panels:
The success-path output (the SVG, HTML, etc.) is still controlled by --format; only error paths change shape.
Related¶
dft serve— interactive preview with auto-reloaddft validate— pre-render validationdft query— inspect one named query without rendering the whole facedft check— sub-second structural validation