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 and suppression 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

# Verify the install: prints the EDP version and exits.
Unity -batchmode -nographics -quit \
  -projectPath /path/to/project \
  -executeMethod Kronnect.EditorDoctorPro.CLI.EDPCommandLine.Run \
  -- --edp-version

Everything after the -- separator is forwarded to EDP. Unity's own batch flags (-batchmode, -projectPath, etc.) go before the separator.

Always use --edp-version. The version flag is --edp-version on every platform. The shorter --version is intercepted by Unity's launcher before -batchmode runs on some host configurations; --edp-version bypasses that consistently on Windows, macOS and Linux.

Flags

FlagArgumentBehaviour
--edp-version-Print the EDP version and exit 0 without running the scan. Always use this form on every OS. (--version is also accepted but the Unity launcher can intercept it before -batchmode takes effect; --edp-version avoids that.)
--checkglobRun only checks whose id matches the glob (e.g. EDP-TEX-*). Repeatable. Default: every enabled rule.
--moduleslugRestrict to one module. Accepted slugs: asset-health, prefab-drift, build-review, conventions, code-audit, scenes. Repeatable. Resolves to the canonical category label internally; advanced users that ship custom categories can pass the raw label via --category instead.
--categoryglobGlob-match against the raw category label of each check (e.g. "Asset Health"). Repeatable. Use --module for the built-in modules.
--scope-includepath prefixRestrict the scan to assets whose path starts with the given project-relative prefix (e.g. Assets/Game/Combat). Repeatable.
--scope-excludepath prefixSkip assets whose path starts with the given prefix. Repeatable.
--report / --json-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.
--fail-onseveritySeverity threshold for the exit code: never (or none), info, warn (or warning), 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.
2Invocation error: a flag was supplied without its required value, --fail-on received an unknown severity, or a report sink failed to write. Unknown flags are logged as a warning and skipped, so a misspelt argument does not bring the build down on its own.

Example: run a Build Review scan (verified)

This is the exact command we use to smoke-test every release of EDP. It scans only the Build Review module and emits both a JSON and an HTML report:

# macOS path; adjust for Windows / Linux Unity installs.
/Applications/Unity/Hub/Editor/6000.0.56f1/Unity.app/Contents/MacOS/Unity \
  -batchmode -nographics -quit \
  -projectPath "$PWD" \
  -executeMethod Kronnect.EditorDoctorPro.CLI.EDPCommandLine.Run \
  -logFile /tmp/edp.log \
  -- \
  --module build-review \
  --json-report /tmp/edp-build-review.json \
  --html-report /tmp/edp-build-review.html \
  --fail-on critical

The relevant lines from /tmp/edp.log after the run completes:

[EditorDoctorPro] CLI exit code: 0

And the JSON report (/tmp/edp-build-review.json) on a clean project:

{
  "schema": "1.0",
  "tool": { "name": "Editor Doctor Pro", "version": "1.0.0", ... },
  "project": { "path": "...", "unityVersion": "6000.0.56f1", "renderPipeline": "Built-in", ... },
  "scan": {
    "checksRun": [
      "EDP-BUILD-001", "EDP-BUILD-002", "EDP-BUILD-003",
      "EDP-BUILD-004", "EDP-BUILD-005", "EDP-BUILD-006"
    ],
    "categoriesRun": ["Build Review"]
  },
  "summary": {
    "totalIssues": 0,
    "fixableCount": 0,
    "suppressedCount": 0,
    "healthScore": 100
  },
  "issues": [],
  "suppressedIssues": []
}

Exit code 0 + healthScore: 100 means the project's Build Settings and shipped Resources/ folders are clean. Swap the module or add more (--module asset-health --module build-review) for broader coverage; lower --fail-on to error to gate the CI lane on regressions.

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 \
  --fail-on error

Run before the platform-specific build step. The CI lane fails on any error-severity finding. 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?