CLI
Hwaro provides commands for creating, building, and serving your site.
Commands
init
Create a new site:
hwaro init my-site
hwaro init my-site --scaffold blog
hwaro init my-site --scaffold docs
Options:
| Flag | Description |
|---|---|
| --scaffold NAME | Use a scaffold template: simple, blog, docs |
| -f, --force | Force creation even if directory is not empty |
| --skip-agents-md | Skip creating AGENTS.md file |
| --skip-sample-content | Skip creating sample content files |
| --skip-taxonomies | Skip taxonomies configuration and templates |
| --include-multilingual LANGS | Enable multilingual support (e.g., `en,ko,ja`) |
new
Create a new content file:
hwaro new content/about.md
hwaro new content/blog/my-post.md
hwaro new -t "My Post Title"
hwaro new posts/my-post.md -a posts
Creates a Markdown file with front matter template. Supports archetypes for customizable templates.
Options:
| Flag | Description |
|---|---|
| -t, --title TITLE | Content title |
| -a, --archetype NAME | Archetype to use |
Archetypes:
Archetypes are template files in archetypes/ directory that define default front matter for new content:
archetypes/default.md- Default template for all contentarchetypes/posts.md- Used forhwaro new posts/...archetypes/tools/develop.md- Used forhwaro new tools/develop/...
Archetype files support placeholders: {{ title }}, {{ date }}, {{ draft }}
Example archetype (archetypes/posts.md):
---
title: "{{ title }}"
date: {{ date }}
draft: false
tags: []
---
# {{ title }}
Archetype matching priority:
- Explicit
-aflag (e.g.,-a postsusesarchetypes/posts.md) - Path-based matching (e.g.,
posts/hello.mdchecksarchetypes/posts.md) - Nested paths try parent archetypes (e.g.,
tools/dev/x.mdtriestools/dev.md, thentools.md) - Falls back to
archetypes/default.md - Uses built-in template if no archetype found
build
Build the site to public/:
hwaro build
hwaro build --drafts
hwaro build --minify
hwaro build -i /path/to/my-site
hwaro build -i /path/to/my-site -o ./dist
Options:
| Flag | Description |
|---|---|
| -i, --input DIR | Project directory to build (default: current directory) |
| -o, --output-dir DIR | Output directory (default: public) |
| --base-url URL | Temporarily override `base_url` from `config.toml` |
| -d, --drafts | Include draft content |
| --minify | Minify output files (see below) |
| --no-parallel | Disable parallel processing |
| --cache | Enable build caching |
| --skip-highlighting | Disable syntax highlighting |
| -v, --verbose | Show detailed output |
| --profile | Print phase-by-phase build timing |
| --debug | Print debug information after build |
About --minify:
The minify flag performs conservative optimization on generated files:
- HTML: Removes comments and trailing whitespace, collapses excessive blank lines. Preserves all indentation, newlines, and content structure.
- JSON: Removes whitespace and newlines for compact output.
- XML: Removes whitespace between tags for smaller file sizes.
Code blocks (<pre>, <code>) and script/style content are always preserved intact.
About -i, --input:
When specified, Hwaro changes its working directory to the given path before building. This lets you build a site located in another directory without cd-ing into it first.
- All site sources (
config.toml,content/,templates/,static/) are read from the input directory. - Without
-o: The default output directorypublic/is created inside the input directory (i.e., the site's ownpublic/folder). This is the natural behavior —hwaro build -i ../my-siteproduces../my-site/public/. - With
-o: The output path is resolved relative to your current directory (not the input directory), sohwaro build -i ../my-site -o ./distwrites output to./distin your shell's CWD. - If
-iis omitted, behavior is unchanged — the current directory is used.
serve
Start a development server with live reload:
hwaro serve
hwaro serve --port 8080
hwaro serve --open
hwaro serve --access-log
hwaro serve -i /path/to/my-site
hwaro serve -i /path/to/my-site -p 8080
Options:
| Flag | Description |
|---|---|
| -i, --input DIR | Project directory to serve (default: current directory) |
| -b, --bind HOST | Bind address (default: 0.0.0.0) |
| -p, --port PORT | Port number (default: 3000) |
| --base-url URL | Temporarily override `base_url` from `config.toml` |
| --minify | Serve minified output |
| --open | Open browser after starting |
| -d, --drafts | Include draft content |
| -v, --verbose | Show detailed output |
| --debug | Print debug information after each rebuild |
| --access-log | Show HTTP access log (e.g. GET requests) |
The server watches for file changes and rebuilds automatically.
When -i is specified, the server operates as if you had cd-ed into the given directory — watching and serving from that project root.
deploy
Deploy the generated site to configured targets.
hwaro deploy [target ...]
hwaro deploy --dry-run
Options:
| Flag | Description |
|---|---|
| -s, --source DIR | Source directory to deploy (default: deployment.source_dir or public) |
| --dry-run | Show planned changes without writing |
| --confirm | Ask for confirmation before deploying |
| --force | Force upload/copy (ignore file comparisons) |
| --max-deletes N | Maximum number of deletes (default: deployment.maxDeletes or 256, -1 disables) |
| --list-targets | List configured deployment targets and exit |
tool
Utility tools for content management:
hwaro tool convert toYAML # Convert frontmatter to YAML
hwaro tool convert toTOML # Convert frontmatter to TOML
hwaro tool list all # List all content files
hwaro tool list drafts # List draft files
hwaro tool list published # List published files
hwaro tool check # Check for dead external links
Subcommands:
| Subcommand | Description |
|---|---|
| convert | Convert frontmatter between YAML and TOML formats |
| list | List content files by status (all, drafts, published) |
| check | Check for dead links in content files |
Common Options:
| Flag | Description |
|---|---|
| -c, --content DIR | Limit to specific content directory |
| -h, --help | Show help |
See Tools & Completion for detailed usage.
completion
Generate shell completion scripts:
hwaro completion bash # Bash completion script
hwaro completion zsh # Zsh completion script
hwaro completion fish # Fish completion script
Installation:
# Bash (add to ~/.bashrc)
eval "$(hwaro completion bash)"
# Zsh (add to ~/.zshrc)
eval "$(hwaro completion zsh)"
# Fish (add to ~/.config/fish/config.fish)
hwaro completion fish | source
See Tools & Completion for detailed installation instructions.
Examples
# Development workflow
hwaro serve --drafts --verbose
# Development with HTTP access log
hwaro serve --access-log
# Production build
hwaro build
# Custom output directory
hwaro build -o dist
# Preview on specific port
hwaro serve -p 8000 --open
# Build a site in another directory
hwaro build -i ~/projects/my-blog
# Build a remote project and output to current directory
hwaro build -i ~/projects/my-blog -o ./output
# Serve a site from another directory
hwaro serve -i ~/projects/my-blog --open
Global Options
| Flag | Description |
|---|---|
| -h, --help | Show help |
| -v, --verbose | Verbose output |