CLI / Batch Mode

advanced feature

Editor Doctor Pro · Features

CLI / 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

FlagArgumentBehaviour
--checkglobRun only checks whose id matches the glob. Repeatable. Default: every enabled rule.
--modulemodule nameRestrict to one module: asset-health, code-audit, prefab-drift, conventions, build-review, scenes. Repeatable.
--scope-includepath globRestrict the scan to assets under the given glob. Repeatable.
--scope-excludepath globSkip assets under the given glob. Repeatable.
--reportfile pathWrite a JSON report to the given path.
--csv-reportfile pathWrite a CSV report to the given path.
--html-reportfile pathWrite an HTML report to the given path.
--baselinefile pathCompare against the saved baseline; the report includes a delta block.
--save-baselinefile pathSave the current scan as a baseline at the given path.
--fail-onseveritySeverity threshold for the exit code: never, info, warn, error, critical. Default: error.

Exit codes

CodeMeaning
0Scan completed; no finding at or above the --fail-on threshold.
1Scan completed; at least one finding at or above the --fail-on threshold.
2Argument error (unknown flag, missing argument, bad path).
3Internal 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.

License activation. Running EDP in batch mode against a stock Unity install requires a valid Unity license activation step (UNITY_LICENSE, UNITY_EMAIL, UNITY_PASSWORD secrets when using game-ci). EDP itself does not gate on a license - the gating is Unity's.
Was this page helpful?