CLI Reference
The complete reference for the prune command.
Synopsis
php vendor/bin/prune [paths...] [options]
Arguments
| Argument | Description |
|---|---|
paths | One or more directories to scan. Optional and repeatable. Falls back to the config paths (default src) when omitted. |
php vendor/bin/prune src
php vendor/bin/prune src app lib
Options
| Option | Shortcut | Value | Description |
|---|---|---|---|
--config | -c | path | Path to a config file. Overrides the default file resolution. |
--format | -f | string | Output format: console, json, or html. Overrides config. |
--output | -o | path | Destination file for json/html output. Overrides the default .prune/ location. |
--blade | — | flag | Only scan Blade views; skips PHP class analysis. |
Standard Symfony Console options also apply, including:
| Option | Description |
|---|---|
-v, -vv, -vvv | Increase verbosity (e.g. prints the scanned file count). |
--help, -h | Show command help. |
--version, -V | Show the application version. |
--no-ansi | Disable colored output. |
Precedence over the config file
When both a CLI value and a config value are present, the CLI wins:
| Setting | Source priority |
|---|---|
| Paths | paths argument → config paths → default src |
| Format | --format → config format → default console |
| Blade | --blade forces Blade-only mode; otherwise blade.enabled from config decides |
Exit codes
| Code | Meaning |
|---|---|
0 | Success — no orphans found. |
1 | Orphans found, or a fatal error (e.g. an invalid output path). |
See CI Integration for how to use exit codes in a pipeline.
Examples
# Scan src/ and print a console table
php vendor/bin/prune src
# Scan multiple directories
php vendor/bin/prune src app lib
# Write a JSON report to a custom path
php vendor/bin/prune src --format=json --output=build/orphans.json
# Use a specific config file
php vendor/bin/prune --config=ci/prune.neon
# Only look for unused Blade views
php vendor/bin/prune resources/views --blade
# Verbose run showing the scanned file count
php vendor/bin/prune src -v