CLI / Batch Mode
advanced featureCLI / Batch Mode
Editor Doctor Pro ships a CLI surface from day one. The CLI runs the same scan engine as the Doctor window, emits the same JSON / CSV / HTML reports, and supports the same scope / suppression / baseline configuration. Use it to gate CI builds, generate scheduled reports, or smoke-test your project from a Makefile.
Entry point
The CLI entry point is the static method Kronnect.EditorDoctorPro.CLI.EDPCommandLine.Run. Invoke it via Unity's standard -executeMethod:
Unity -batchmode -nographics -quit \
-projectPath /path/to/project \
-executeMethod Kronnect.EditorDoctorPro.CLI.EDPCommandLine.Run \
-- \
--check "EDP-*" \
--report run-report.json \
--fail-on error
Everything after the -- separator is forwarded to EDP. Unity's own batch flags (-batchmode, -projectPath, etc.) go before the separator.
Flags
| Flag | Argument | Behaviour |
|---|---|---|
--check | glob | Run only checks whose id matches the glob. Repeatable. Default: every enabled rule. |
--module | module name | Restrict to one module: asset-health, code-audit, prefab-drift, conventions, build-review, scenes. Repeatable. |
--scope-include | path glob | Restrict the scan to assets under the given glob. Repeatable. |
--scope-exclude | path glob | Skip assets under the given glob. Repeatable. |
--report | file path | Write a JSON report to the given path. |
--csv-report | file path | Write a CSV report to the given path. |
--html-report | file path | Write an HTML report to the given path. |
--baseline | file path | Compare against the saved baseline; the report includes a delta block. |
--save-baseline | file path | Save the current scan as a baseline at the given path. |
--fail-on | severity | Severity threshold for the exit code: never, info, warn, error, critical. Default: error. |
Exit codes
| Code | Meaning |
|---|---|
| 0 | Scan completed; no finding at or above the --fail-on threshold. |
| 1 | Scan completed; at least one finding at or above the --fail-on threshold. |
| 2 | Argument error (unknown flag, missing argument, bad path). |
| 3 | Internal error (unexpected exception during scan or report write). |
Example: pre-build CI gate
Unity -batchmode -nographics -quit \
-projectPath . \
-executeMethod Kronnect.EditorDoctorPro.CLI.EDPCommandLine.Run \
-- \
--module asset-health --module build-review \
--report ci/edp-report.json \
--html-report ci/edp-report.html \
--baseline ci/edp-baseline.json \
--fail-on error
Run before the platform-specific build step. The CI lane fails on any new error-severity finding vs the saved baseline. Attach edp-report.html to the build artefact for review.
Example: targeted rule sweep
# Audit just the Code Audit performance rules over a refactored subtree.
Unity -batchmode -nographics -quit \
-projectPath . \
-executeMethod Kronnect.EditorDoctorPro.CLI.EDPCommandLine.Run \
-- \
--check "EDP-CODE-PERF-*" \
--scope-include "Assets/Game/Combat/**" \
--report perf-report.json \
--fail-on never
GitHub Actions
The EDP repo ships a reference workflow at .github/workflows/edp-acceptance.yml. It is workflow_dispatch-only (manual trigger). The workflow runs the CLI against the synthetic project under Tests/SyntheticProject and pipes the report through a verifier method (ManifestVerifier.Run) that compares findings against expectations declared in Tests/SyntheticProject/Fixtures/manifest.json. Use it as a template for your own CI lane.
UNITY_LICENSE, UNITY_EMAIL, UNITY_PASSWORD secrets when using game-ci). EDP itself does not gate on a license - the gating is Unity's.
Suggest an improvement
Help us improve this documentation page.