Skip to content

CLI Reference

mir [OPTIONS] [PATHS]...

Paths default to the current directory when omitted.

Flag Default Description
--format <FORMAT> text Output format (see below)
--show-info off Include info-level issues (redundancies, style)
-j, --threads <N> CPU count Parallelism
--cache-dir <DIR> off Enable incremental cache in DIR
--stats off Print file count, error/warning totals, elapsed time
-v, --verbose off Print per-file issue counts
-q, --quiet off Suppress all output; use exit code only
--no-progress off Disable the progress bar
--php-version <X.Y> 8.5 Target PHP version (e.g. 7.4, 8.2). Supported range: 7.48.5.
-c, --config <FILE> auto Config file (mir.xml / psalm.xml auto-discovered)
--baseline <FILE> off Suppress issues listed in a baseline XML
--error-level <1-8> Override global error level (1 = errors only)
--set-baseline [FILE] Write all current issues to a baseline file and exit
--update-baseline off Remove resolved issues from the baseline
--ignore-baseline off Report all issues, ignoring the baseline
--version Print version
Format Use case
text Default terminal output with colors
json Machine-readable array of issue objects
github GitHub Actions annotations (::error file=…)
junit JUnit XML — compatible with most CI systems
sarif SARIF 2.1.0 — GitHub Code Scanning / VS Code
Code Meaning
0 No errors found
1 One or more errors found
Terminal window
# Basic analysis
mir src/
# CI with GitHub Actions annotations
mir --format github --no-progress src/
# JUnit XML output for CI systems
mir --format junit --no-progress src/ > results.xml
# Target a specific PHP version
mir --php-version 8.2 src/