Command-line interface for PostHTML, a tool for transforming HTML/XML with plugins. Current stable version is 0.10.0, with releases roughly every few months. It supports processing multiple files, glob patterns, custom config files (JSON/JS), and built-in notifications for updates. Compared to alternatives like html-postcss or custom scripts, posthtml-cli provides a simple CLI with plugin loading and file watching. Requires Node >=10. Currently in maintenance mode with no major recent activity.
npm install posthtml-cliVerified import paths — ran on the pinned version, not inferred.
Install globally, process HTML files with plugins defined in config.
If using a config function that returns a promise, ensure compatibility; previously only synchronous was supported.
Use --all-in-out instead of --all-in-output.
Use forward slashes or double backslashes in glob patterns on Windows.
Check documentation for plugin order precedence (CLI overrides config?).
Run npm install -g posthtml-cli or use npx posthtml-cli.
Check the pattern: use 'src/**/*.html' for all HTML files in src/
Install posthtml-load-config: npm install posthtml-load-config --save-dev