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:

Archetype files support placeholders: {{ title }}, {{ date }}, {{ draft }}

Example archetype (archetypes/posts.md):

---
title: "{{ title }}"
date: {{ date }}
draft: false
tags: []
---

# {{ title }}

Archetype matching priority:

  1. Explicit -a flag (e.g., -a posts uses archetypes/posts.md)
  2. Path-based matching (e.g., posts/hello.md checks archetypes/posts.md)
  3. Nested paths try parent archetypes (e.g., tools/dev/x.md tries tools/dev.md, then tools.md)
  4. Falls back to archetypes/default.md
  5. 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:

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.

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