CLI reference
postcss-go processes CSS files through the Go engine while loading the same
configuration shape used by PostCSS projects.
At a glance
| Area | What it does | Typical entry |
|---|---|---|
| Files | Process one file, a directory, or a glob | postcss-go src/**/*.css --dir dist |
| Output | Write a file, directory, or replace inputs | -o, --dir, --replace |
| Plugins | Load a PostCSS plugin chain | -u autoprefixer |
| Development | Re-run when source files change | -w, --watch |
| Maps | Generate or disable source maps | --no-map |
Inputs and output
postcss-go input.css -o output.csspostcss-go src/**/*.css --base src --dir buildcat input.css | postcss-go -u autoprefixer > output.csspostcss-go input.css --replace| Option | Description |
|---|---|
-o, --output <file> |
Write one input to a specific output file. |
--dir <directory> |
Write a directory or glob input to a directory. |
--replace |
Replace input files in place. |
--base <directory> |
Remove a base path when calculating output paths. |
-w, --watch |
Re-process files when they change. |
--no-map |
Disable source-map output. |
-u, --use <plugin> |
Load a plugin by package name. |
Configuration and plugins
The CLI loads postcss.config.js, .cjs, or .mjs with
postcss-load-config. JavaScript plugins run through the Node compatibility
layer before the Go engine handles parsing, stringifying, and source maps.
postcss-go src/**/*.css --dir dist --base src --no-mappostcss-go input.css -u autoprefixer -o output.cssWatch mode
Use --watch with a file, directory, or glob. Combine it with --dir for
multi-file projects or --replace for in-place development workflows.