Scanning
Scanning
preflight scan runs every enabled check against the project in the current directory, or in the directory you name.
preflight scan # the current directory
preflight scan /path/to/project # another oneFlags
| Flag | What it does |
|---|---|
-v, --verbose |
Show detail for each check, including which files matched |
--only <ids> |
Run only these checks or services, comma-separated |
--skip <ids> |
Skip these checks or services for this run |
--ci |
Run without prompts, for CI |
--format json |
Print JSON instead of the human report |
--publish |
Send the results to your dashboard |
--only and --skip take the IDs that preflight checks lists. They are for a single run, and they leave preflight.yml as it is. To silence a check for good, use preflight ignore.
# Rerun only what you are fixing.
preflight scan --only seo_meta,og_twitter
# Leave out the slow or risky ones.
preflight scan --skip vulnerability,secretsJSON output
--format json prints one JSON document with a schema_version, the CLI version, the project name, a summary and one entry per check:
{
"schema_version": 1,
"cli_version": "0.22.0",
"project": "acme-store",
"summary": { "ok": 7, "warn": 9, "fail": 2 },
"checks": [
{
"id": "canonical",
"title": "Canonical URL",
"passed": false,
"severity": "warn",
"message": "No canonical URL tag found",
"suggestions": ["Set metadataBase in root layout.tsx"]
}
]
}severity is info for a check that passed, warn or error for one that didn’t. schema_version 1 is the 1.0 contract, with snake_case check IDs. Output with no schema_version came from a CLI older than 0.22, which used camelCase IDs.
Exit codes
| Code | Meaning |
|---|---|
0 |
Every check passed |
1 |
Warnings only |
2 |
At least one check found an error |
64 |
Preflight could not run: a bad path, an unreadable config, or an unknown check ID |
130 |
The scan was cancelled (Ctrl-C or SIGTERM) |
Codes 1 and 2 mean the scan ran and reported something. Code 64 means it never got that far, so CI can tell "this project has problems" apart from "this command was wrong".
Color
Output is colored in a terminal and plain when piped. It also respects the NO_COLOR environment variable.
Shell completions
Tab completion for commands, flags and check IDs, including the values of --only and --skip:
# bash (add to ~/.bashrc)
source <(preflight completion bash)
# zsh (add to ~/.zshrc)
source <(preflight completion zsh)
# fish
preflight completion fish | source