Command-line Reference

Trail provides commands for building, serving, and checking documentation. trail(1) is the authoritative command reference, including every option, exit status, environment input, and output path. Use trail --help for a summary or trail help build for one command.

Building a site #

Run trail build --strict from the directory containing trail.toml to check descriptions and build the site. The build validates links even without --strict. Read Building and Serving for a worked procedure and output ownership rules.

Previewing changes #

Run trail serve to preview the site while editing. It rebuilds after source changes and reloads connected browsers. Failed builds report a warning while the server stays running. Output can contain partial writes from a failed build; it is not an atomic snapshot of the last success.

Checking writing #

Run trail lint separately from a build. Findings and totals go to stderr. Each finding names its source path, line, column, and rule. A warning uses trail: warning:; an error uses trail:. The exit status is 1 if a rule reports an error, and 0 if there are only warnings or no findings. Checking Style explains configuration.

Exit status and streams #

Help, version, and successful commands exit with status 0. Operational failures exit with status 1. Usage errors exit with status 2. Running Trail without arguments prints help to stderr and exits with status 2. Build and server progress use stdout. Errors, warnings, and lint findings use stderr. Plugin diagnostics retain the plugin's own formatting.

Installing #

Build Trail from its source directory:

pekit build trail

pekit prints where the result is, under pekit-out/. Run tools/install to install the binary and manuals under $HOME/.local. See Building Trail for prerequisites, checks, and a custom installation prefix. Read a manual directly with man ./man/trail.1 from the source directory.

Edit this page