Loading...
Loading...
Drives a running Unity Editor or dev Player through the unity-pipeline package — recompile, run tests, run C# scripts, method-reload code at runtime and audit the project. Use when an agent must control a live Unity instance or automate its tests.
npx skill4agent add unity-technologies/skills unity-pipelineunity command <name> [args]unity command7800-78497900-7949unity command --query <term>unity pipeline install # install into current project (or --project-path)
unity pipeline list # confirm the editor instance + server are reachable
unity status --until-ready # wait until the editor server is ready
unity command editor_status # confirm the editor server answersunity statusSTATUS_PIPELINE_LOAD_PENDINGunity status --until-ready# 1. Keep the editor ticking even when unfocused/minimized. REQUIRED before headless work —
# Unity otherwise throttles or stalls update/compile when it isn't the active app.
unity command set_autotick --enable true
# 2. Edit C# source files on disk normally.
# 3. Recompile (async: triggers a domain reload, then poll until done).
unity command recompile
unity command recompile_status # repeat until "completed" or "up_to_date"
# Tolerate connection errors while the domain reload is in flight — that is expected.
# If recompile_status reports failed=true, read its "errors" array and fix before testing.
# 4. (Optional) List available tests without running them.
unity command list_tests --mode editor # mode: all | editor | playmode
# 5. Run tests (filter to keep it fast).
unity command run_tests --mode editor --filter MyFixture.MyTestrun_testsalleditorplaymodefilter_typetestNameassemblycategory--async_tests trueunity command test_statusunity command cancel_testsKnown caveat: when any selected test fails,may surface an opaque result instead of the failure details. Re-run a narrowerrun_tests, or inspect the editor's Test Runner / logs to get the real failure.--filter
| Exit | Meaning | What to do |
|---|---|---|
| Bad arguments — a misspelled flag, a wrong type, too many positionals. Nothing ran. | Fix the command line and retry. The error names the problem and often suggests the right flag. |
| The command ran and failed, or no Editor could be reached. | Read the error. If it says no Pipeline instance was found, the Editor isn't reachable: wait with |
unity command editor_playAwakereload_file[MethodReload]unity command reload_file --filename Assets/Spinner.cs--pdbunity command reload_file --filename Assets/Spinner.cs --pdbvoid--pdbunity command methodreload_statusreload_file--timeout <ms>--assemblyDir <dir>cleanup_methodreload --assemblyDir <dir>--timeout--timeout--unity command reload_file -- --filename Assets/Spinner.cs --timeout 60000run_scriptrun_script# 1. Write the builder OUTSIDE Assets/ (so the write triggers no asset import / domain reload),
# e.g. AgentScripts/Build.cs: public static class Build { public static int All() { ... } }
# 2. Run it — relative paths resolve against the project root (the parent of Assets/):
unity command run_script --file AgentScripts/Build.cs --entry Build.All
# 3. Iterate: edit the file, re-run. Useful extras:
unity command run_script --file AgentScripts/Build.cs --dry_run true # compile-only check: diagnostics, nothing loaded or executed
unity command run_script --file AgentScripts/Build.cs --entry Build.All --args '[3, "Green"]'run_scriptevalevalUNITY_EDITOR--definesasync TaskTask<T>Task<T>.Resulttimeout_msfile:line--mode hotpatch[MethodReload]reload_fileentryargsdry_runreferencesdefinesrun_scripteval--runtime <process name>unity command eval "return 2 + 2;"
unity command eval "return UnityEngine.Time.timeScale;" --runtime MyGame
# Or evaluate a .cs file on disk. Keep it outside Assets/, where Unity would compile it as project source:
unity command eval_file AgentScripts/Scratch.csunity command audit # optional: --categories Code,ProjectSetting --output my.csv
unity command audit_status # repeat until terminal statusaudit_statuscompletedcsvPathissueCountfailedunavailableinterruptedauditauditbusyCategory, Severity, Areas, Description, RelativePath, Line, DescriptorId, RecommendationRecommendationRequires Project Auditor plus its rules.means the Editor has no Project Auditor, or it has no analysis rules — in a built-in-module Editor the rules live in the separateunavailablepackage (com.unity.project-auditor-rules). Read theunity command package_add --identifier com.unity.project-auditor-rules --confirm truefield; the command never reports an emptymessagescan that would look like a clean project.completed
set_autotickunity command editor_statusstatus: "blocked_by_dialog"dialog.titlemessagebuttonsreload_fileunity command editor_playlogset_timescaleruntime_statusrecompilerecompile_statusrun_tests --async_teststest_status--project-path <path>--runtime <process name>--runtime-path <port file>