Project: rehypejs/rehype

Package: rehype-cli@10.0.0

  1. Dependencies: 0·Dependents: 0
  2. CLI to process HTML with rehype
  1. unified 117
  2. html 108
  3. rehype 69
  4. cli 4
  5. bin 2


Build Coverage Downloads Sponsors Backers Chat

Command line interface for rehype.


🥇 Vercel

🥇 Gatsby

🥇 Netlify



Read more about the unified collective on Medium »



npm install rehype-cli


# Minify `index.html` with `rehype-preset-minify`:
$ rehype index.html --use preset-minify --output


See unified-args, which provides the interface, for more information on all available options.

Usage: rehype [options] [path | glob ...]

  CLI to process HTML with rehype using plugins


  -h  --help                output usage information
  -v  --version             output version number
  -o  --output [path]       specify output location
  -r  --rc-path <path>      specify configuration file
  -i  --ignore-path <path>  specify ignore file
  -s  --setting <settings>  specify settings
  -e  --ext <extensions>    specify extensions
  -u  --use <plugins>       use plugins
  -w  --watch               watch for changes and reprocess
  -q  --quiet               output only warnings and errors
  -S  --silent              output only errors
  -f  --frail               exit with 1 on warnings
  -t  --tree                specify input and output as syntax tree
      --report <reporter>   specify reporter
      --file-path <path>    specify path to process as
      --tree-in             specify input as syntax tree
      --tree-out            output syntax tree
      --[no-]stdout         specify writing to stdout (on by default)
      --[no-]color          specify color in report (on by default)
      --[no-]config         search for configuration files (on by default)
      --[no-]ignore         search for ignore files (on by default)


  # Process `input.html`
  $ rehype input.html -o output.html

  # Pipe
  $ rehype < input.html > output.html

  # Rewrite all applicable files
  $ rehype . -o


As rehype works on HTML, and improper use of HTML can open you up to a cross-site scripting (XSS) attack, use of rehype can also be unsafe. Use rehype-sanitize to make the tree safe.


See contributing.md in rehypejs/.github for ways to get started. See support.md for ways to get help. Ideas for new plugins and tools can be posted in rehypejs/ideas.

A curated list of awesome rehype resources can be found in awesome rehype.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.


MIT © Titus Wormer