CLI

Methanol includes a dedicated Command-line Interface (CLI) designed to streamline development, execution of static builds, and local previews.

Core Commands

Quick start with npx (recommended):

npx methanol dev      # Initialize the development server
npx methanol build    # Execute production build to the dist/ directory
npx methanol serve    # Preview the production build locally

For improved performance and faster startup times, consider a global installation:

npm install methanol -g
methanol dev

The input and output paths can be provided as positional arguments (order is significant):

npx methanol build ./pages ./dist

In dev mode, only the input argument is utilized:

npx methanol dev ./pages

For serve/preview, the first positional argument is treated as the output directory:

npx methanol serve ./dist

Flag Reference

Syntax highlighting is enabled by default and can be disabled per-execution via --no-highlight.

Execution via Node

node node_modules/methanol/bin/methanol.js dev