CLI commands
@foliolang/cli ships 5 subcommands.
init
folio init
Interactive wizard. Generates a sample article.md + folio.config.json + .env.example.
build
folio build article.md [--theme default|academic|minimal] [--inline] [--pdf]
| Flag | Description |
|---|---|
--theme |
Theme (default: default) |
--inline |
Inline every asset into a single HTML file (no external deps) |
--pdf |
Also emit article.pdf (requires puppeteer installed locally) |
Outputs article.html plus (optionally) an article.assets/ directory.
dev
folio dev article.md [--port 5173]
Starts a local server. File changes trigger a rebuild and a browser refresh.
publish
folio publish article.md --target cloudflare|github|netlify|s3 [--slug my-article]
Publishes to the configured target and returns the URL. Requires the matching token / API key in env.
cache
folio cache stats # cache hit rate + estimated spend
folio cache clean # wipe the content-addressed cache
Exit codes
build exits non-zero when:
- The source file cannot be read.
- An engine fails fatally (the HTML is still written, with error placeholders).