Command-line interface for Pug (formerly Jade) template engine, version 1.0.0-alpha6. Allows compiling .pug files to HTML or client-side JavaScript. Supports watching, pretty-printing, custom output directories, and options via JSON/JS files. Primarily used for build tooling and static site generation. Maintained as part of the Pug project, though the CLI is in alpha with infrequent releases. Alternatives include gulp-pug or webpack loaders for integrated workflows.
npm install pug-cliVerified import paths — ran on the pinned version, not inferred.
Install pug-cli globally, create a .pug file, compile with JSON options from stdin, output HTML.
Use --client only for client-side compilation, and include pug-runtime in your project.
Use --name explicitly instead.
Ensure output directory exists before running, or use mkdirp.
Use double quotes for JSON: pug -O '{"key": "value"}' file.pugEnsure all template files have .pug extension.
npm install -g pug-cli
npm install pug
Create output directory: mkdir -p <outdir>
Use valid JSON with double quotes: pug -O '{"key": "value"}' file.pug