CLI reference
The CLI is intentionally small: choose files, choose whether output is safe-by-default or in-place, and let the file extension select the syntax mode.
Basic form
minify [options] file [file ...] Default sibling output
minify public/app.js
# writes public/app.min.js If the source already has a final extension, .min is inserted before it. This makes the original easy to compare, diff or restore.
In-place mode
minify --in-place public/app.js
minify -i public/app.js The write path is intentionally separate from the transformation path. Minify++ prepares a complete sibling temporary output before replacing an existing regular file, preserves its permission bits and rejects symbolic-link destinations. Malformed input or a failed temporary write therefore does not truncate the previous file.
Multiple files
minify index.html assets/site.css assets/app.js data/catalog.json Each file is minified according to its own extension. A failure is attributed to the file that could not be processed.
Version and help
minify --version
minify --help Directory workflows
The current CLI accepts named regular files, not directories. Let your shell, task runner or build system discover files and pass those paths to minify. Dependency graphs, compilation and deployment policy deliberately remain outside Minify++.
Exit status
Automation should treat non-zero exit status as a failed optimisation step. Minify++'s job in CI is simple: either produce valid minified artifacts or fail clearly enough that the deployment can stop.
Failure behavior
- Unreadable inputs are errors, not empty files.
- Unknown extensions and options fail clearly.
- Malformed supported input returns a format-attributed failure where the mode validates it.
- Existing directories, symbolic links and other non-regular destinations are not silently replaced.
- Multiple files are processed independently; the command returns failure if any item fails, so earlier successful outputs may exist.
What is not currently a CLI feature
There is no recursive directory mode, glob expansion, stdin/stdout filter mode, configuration file, watch process, bundling graph or plugin loader. Shell expansion and build orchestration remain external.