CLI Scanner

Estimated reading time: less than 1 minute

The xss-scan command-line tool runs the XSS analysis engine against an entire project or specific files.

Command

xss-scan [options] [files...]

When called without file arguments, scans all files included by the project's tsconfig.json. When file paths are provided, only those files are analyzed.

Options

FlagDescription
--cwd <path>Working directory. Defaults to current directory.
-p, --project <path>Path to tsconfig.json. Defaults to tsconfig.json in the working directory.
-s, --simplifiedCompact single-line diagnostic output.
--versionPrint version and exit.

Exit codes

CodeMeaning
0No issues found.
1Errors found (TS88601, TS88602, TS88603).
2Warnings only (TS88604).

How it works

The CLI creates a TypeScript program from the specified tsconfig.json, loads all source files, and runs the same analysis engine used by the editor plugin. Diagnostics are printed to the terminal with colored output. The process exits with the appropriate code for CI gate integration.