Command line

merodi <command> [args] [options]

Running merodi with no command, an unknown command, or -h prints the help text.

Commands

Command What it does
init, new Create a new project
build Build the site
watch Watch for changes and run your hooks
clean Remove the build output
hook <name> [args] Run a hook
version Show the version

Options

Option Meaning
-C <dir> Project folder. The default is the current folder.
--release Use release mode. The default is draft.
-h, --help Show help
-v, --version Show the version

Options can go anywhere in the command line.

init

merodi init -C blog

Creates config.toml and the src/md, src/templates and src/plugins folders, with a starter page, template and plugin. The folder is created if it is missing. Fails if config.toml is already there. See Quick start.

build

merodi build
merodi build --release
merodi build -C blog --release

Builds every file under the markdown folder into draft_dest, or into release_dest with --release. Runs your plugins and hooks. Stops at the first error. See Build and hooks.

watch

merodi watch

Runs until you stop it with Ctrl-C. It calls the on_start_watching and on_file_changed hooks. In 0.5.2 it does not build by itself, your hook starts the build. See Watching.

clean

merodi clean
merodi clean --release

Deletes the draft output folder, or the release one with --release. Plugins are not loaded for clean.

hook

merodi hook <name> [args]
merodi hook deploy me@example.com:/var/www

Calls the Lua function registered with merodi.hook("<name>", ...) and passes the extra words as strings. Needs a name, otherwise it prints the help.

version

merodi version
merodi --version

Prints Merodi 0.5.2, and the git commit when built from a checkout.

Output and exit status

Messages look like [INFO]: text, [WARN]: text and [ERROR]: text. After an error Merodi exits with status 1, so scripts and CI can detect a failed build.

Help text

Merodi 0.5.2 - static site generator

USAGE:
  merodi <command> [args] [options]

COMMANDS:
  init, new           Create a new project
  build               Build the site
  watch               Rebuild on file changes
  clean               Remove build output
  hook <name> [args]  Run a hook
  version             Show version

OPTIONS:
  -C <dir>            Project directory (default: current)
  --release           Build in release mode (default: draft)
  -h, --help          Show this help
  -v, --version       Show version

EXAMPLES:
  merodi new -C blog
  merodi build -C blog --release
  merodi hook deploy arg1 arg2 -C blog
  merodi watch