### PipelineTestServer constructor setup Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/testing.html Creates a TestEditorPipelineServer, starts it on a port in 7850-7899, and creates a PipelineClient with a token. Wrap in a using block to stop the server at test end. ```csharp public PipelineTestServer() { m_Server = new TestEditorPipelineServer(); m_Server.Start(); // auto-assigns a port in 7850-7899; writes no descriptor m_Client = new PipelineClient($"http://127.0.0.1:{m_Server.Port}", SecurityTokenManager.GetOrCreateToken()); } ``` -------------------------------- ### StartServer() Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.RuntimePipelineDriver.html Manually starts the Pipeline server. ```APIDOC ## StartServer() ### Description Manually starts the Pipeline server. ### Method StartServer ### Signature public void StartServer() ``` -------------------------------- ### Start(int port = 0) Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.BasePipelineServer.html Starts the HTTP server on the specified port or auto-assigns from the server-specific range. ```APIDOC ## Start(int port = 0) ### Description Starts the HTTP server on the specified port or auto-assigns from the server-specific range. ### Method Start ### Parameters - **port** (int) - Optional - Port to bind to, or 0 for auto-assignment from server-specific range. ### Declaration ```csharp public void Start(int port = 0) ``` ``` -------------------------------- ### GET /api/commands?detail=compact&tag=baking/lighting&limit=2 response Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/connectivity.html Example response for a flat commands query. Shows the commands array with two commands, count=2, total=6, and the server block. ```json { "commands": [ { "name": "bake_lighting", "description": "Trigger an async lightmap bake of the open scene(s) via Lightmapping.BakeAsync(). Returns immediately; poll lighting_bake_status until completed.", "tags": ["baking/lighting"], "package": "Unity.Pipeline.Editor" }, { "name": "cancel_lighting_bake", "description": "Cancel an in-progress lighting bake (Lightmapping.Cancel()).", "tags": ["baking/lighting"], "package": "Unity.Pipeline.Editor" } ], "count": 2, "total": 6, "offset": 0, "limit": 2, "server": { "version": "0.0.1", "port": 54321, "startTime": "2026-07-29T09:14:22.113Z" } } ``` -------------------------------- ### StartedAt Property Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.RuntimePipelineServer.html Gets the UTC time this server instance started listening. ```APIDOC ## StartedAt Property ### Description Gets the UTC time this server instance started listening. ### Declaration public override DateTime StartedAt { get; } ### Property Value - **DateTime** - The UTC time the server started. ``` -------------------------------- ### GET /api/commands?detail=tags response Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/connectivity.html Example response for detail=tags. Returns a tags array with distinct tag paths and subtree counts, plus pagination counters and server block. ```json { "tags": [ { "tag": "assets", "count": 12 }, { "tag": "assets/import", "count": 3 }, { "tag": "assets/text", "count": 2 } ], "count": 50, "total": 50, "offset": 0, "limit": null, "server": { "version": "0.7.0", "port": 7801, "startTime": "..." } } ``` -------------------------------- ### build Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/index.html Starts an asynchronous Player build. Poll the build_status command to check progress and completion. ```APIDOC ## build ### Description Starts an asynchronous Player build. Poll the `build_status` command to check progress and completion. ### Command `build` ### Parameters None. ### Response No direct response. Use `build_status` to poll the build status. ``` -------------------------------- ### Example batch with cross-operation references Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/commands/batch.html Example batch that creates a GameObject, adds a Rigidbody, and sets its mass. The second op references the first op's result via "$0.instanceId", and the third op references the second op's result via "$1.instanceId". Demonstrates the cross-operation reference syntax in a real batch. ```json { "operations": [ { "command": "create_gameobject", "params": { "name": "Ball" } }, { "command": "add_component", "params": { "target": "$0.instanceId", "type": "Rigidbody" } }, { "command": "set_serialized_field", "params": { "target": "$1.instanceId", "field": "m_Mass", "value": 2.5 } } ] } ``` -------------------------------- ### Editor descriptor JSON example Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/connectivity.html Example of the JSON instance descriptor written by the Editor server. Contains fields like pid, port, projectPath, projectName, unityVersion, mode, startedAt, lastHeartbeat, evalToken, capabilities, and info. The info field is only set when the Editor is interactive and not launched with -automated. ```json { "pid": 12345, "port": 7800, "projectPath": "/path/to/Project", "projectName": "Project", "unityVersion": "6000.x.y", "mode": "editor", "startedAt": "2026-06-25T10:00:00Z", "lastHeartbeat": "2026-06-25T10:05:00Z", "evalToken": "", "capabilities": ["exec.argv", "exec.commandLine"], "info": "This editor has not been opened in automated mode and therefore could get stuck on modal dialogs. Human intervention may be required." } ``` -------------------------------- ### GET /api/progress response example Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/connectivity.html Example JSON response from polling GET /api/progress while a command executes. The pct field is 0-1, progress fields are optional, and progress is omitted when nothing is reported. ```json { "active": true, "progress": { "title": "Generating World", "info": "Processing 42/100", "current": 42, "total": 100, "pct": 0.42 } } ``` -------------------------------- ### RuntimePipelineBootstrap.Bootstrap() Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.RuntimePipelineBootstrap.html Core bootstrap logic, split out from the attributed entry point so tests can invoke it directly instead of waiting for a real domain/Player boot. Returns the created driver, or null if the server should not start (no config asset, or disabled). Idempotent: a second call returns the existing Instance rather than creating a duplicate. ```APIDOC ## Method: Bootstrap() ### Description Core bootstrap logic, split out from the attributed entry point so tests can invoke it directly instead of waiting for a real domain/Player boot. Returns the created driver, or null if the server should not start (no config asset, or disabled). Idempotent: a second call returns the existing Instance rather than creating a duplicate. ### Declaration ```csharp public static RuntimePipelineDriver Bootstrap() ``` ### Returns - **RuntimePipelineDriver** - The created (or already-existing) driver, or null if the server should not start. ``` -------------------------------- ### ObjectResolver.Describe Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/authoring-commands.html Generates an AuthoringResult for a given object, filling in the appropriate identity fields based on the object kind. Assets get assetPath, guid, fileId, type (+ globalId). Scene/loaded objects get instanceId, hierarchyPath, type (+ globalId). ```APIDOC ## ObjectResolver.Describe ### Description Generates an AuthoringResult for a given object, filling in the appropriate identity fields based on the object kind. Assets get assetPath, guid, fileId, type (+ globalId). Scene/loaded objects get instanceId, hierarchyPath, type (+ globalId). ### Method Describe ### Signature `public static AuthoringResult Describe(Object obj)` ### Parameters - **obj** (Object) - Required - The object to describe. ### Returns - **AuthoringResult** - The identity result for the object, or null if the object is not recognized. ### Remarks - Use this method to return object identity from commands that create or modify objects. - The returned AuthoringResult is identity only — no success flag, no message. Success/failure and timing live in the outer CommandExecutionResponse. - To report a failure, throw an exception (ArgumentException for bad input, InvalidOperationException for an operation that failed). - For a batch, return a model that holds an AuthoringResult[] (see CreateGameObjectsResult). ### Example ```csharp var result = ObjectResolver.Describe(asset) ?? new AuthoringResult { Type = nameof(Material) }; result.AssetPath = assetPath; // ensure the path is set even if Describe returned a fresh result return result; ``` ``` -------------------------------- ### Initialize(RuntimePipelineConfig, IReadOnlyList, string) Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.RuntimePipelineDriver.html Supplies configuration and baked code-reload roots. Must be called once, immediately after AddComponent (before the end of the current frame, i.e. before Start runs). ```APIDOC ## Initialize(RuntimePipelineConfig, IReadOnlyList, string) ### Description Supplies configuration and baked code-reload roots. Must be called once, immediately after AddComponent (before the end of the current frame, i.e. before Start runs). ### Method Initialize ### Signature public void Initialize(RuntimePipelineConfig config, IReadOnlyList allowedReloadRoots, string pushPublicKey = "") ### Parameters - **config** (RuntimePipelineConfig) - Required - The configuration to run with. - **allowedReloadRoots** (IReadOnlyList) - Required - Absolute roots this build may code reload source files from. - **pushPublicKey** (string) - Optional - Public half of the push-signing key pushes must be signed with; empty rejects all pushes. ``` -------------------------------- ### CodeReloadRegistry.AllowedReloadRoots Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.CodeReload.CodeReloadRegistry.html Gets or sets the absolute roots a running Player is allowed to code reload source files from. Baked into RuntimePipelineBuildInfo at build time and published when the runtime server starts. ```APIDOC ## Property: AllowedReloadRoots ### Description Gets or sets the absolute roots a running Player is allowed to code reload source files from (Assets folder + loaded package locations). Baked into RuntimePipelineBuildInfo at build time and published here when the runtime server starts, so reload commands can validate incoming file paths. Null until published. ### Declaration ```csharp public static IReadOnlyList AllowedReloadRoots { get; set; } ``` ### Property Value - **IReadOnlyList** - The allowed reload roots. ``` -------------------------------- ### Connect to a running Player with the unity CLI Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/connectivity.html Use `--runtime` to target a running development Player by process name, or `--runtime-path` to specify the folder or bundle where the runtime port file lives. These options go after `command` and before the command name. ```bash # By Player process/executable name unity command --runtime MyGame.exe runtime_status # By the folder/bundle where the runtime port file lives unity command --runtime-path "C:\Builds\MyGame" runtime_status # Windows: next to the .exe unity command --runtime-path "/Users/me/Builds/MyGame.app" runtime_status # macOS: the .app bundle ``` -------------------------------- ### GET /api/commands?detail=compact&tag=baking&group_by=tag&limit=2 response Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/connectivity.html Example response for group_by=tag. Shows a nested groups tree where a node's commands holds only exact-tag commands and count covers the subtree. Pagination happens before grouping. ```json { "groups": [ { "tag": "baking", "count": 2, "commands": [], "children": [ { "tag": "baking/lighting", "count": 1, "commands": [ { "name": "bake_lighting", "description": "Trigger an async lightmap bake of the open scene(s) via Lightmapping.BakeAsync(). Returns immediately; poll lighting_bake_status until completed.", "tags": ["baking/lighting"], "package": "Unity.Pipeline.Editor" } ], "children": [] }, { "tag": "baking/navmesh", "count": 1, "commands": [ { "name": "bake_navmesh", "description": "Trigger an async legacy NavMesh bake of the open scene(s) via UnityEditor.AI.NavMeshBuilder. Returns immediately; poll navmesh_bake_status until completed.", "tags": ["baking/navmesh"], "package": "Unity.Pipeline.Editor" } ], "children": [] } ] } ], "count": 2, "total": 17, "offset": 0, "limit": 2, "server": { "version": "0.0.1", "port": 54321, "startTime": "2026-07-29T09:14:22.113Z" } } ``` -------------------------------- ### Build and verify commands: recompile, recompile_status, create_material Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/authoring-commands.html Verifies new authoring commands in the live editor: recompile to register, poll recompile_status until done, then run create_material. ```text command recompile command recompile_status # poll until done command create_material --path Materials/Stone ``` -------------------------------- ### Describe(Object obj) Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.Editor.Authoring.ObjectResolver.html Produces the canonical identity for an object. Assets get path/guid/fileId; loaded objects get instanceId/hierarchyPath. Returns null for a null object. ```APIDOC ## Describe(Object obj) ### Description Produces the canonical identity for an object. Assets get path/guid/fileId; loaded objects get instanceId/hierarchyPath. Returns null for a null object. ### Method Describe ### Signature public static AuthoringResult Describe(Object obj) ### Parameters - **obj** (Object) - The object to describe. ### Returns - **AuthoringResult** - The object's canonical identity, or null if `obj` is null. ``` -------------------------------- ### CodeReloadRegistry.NoteForFirstReload(string) Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.CodeReload.CodeReloadRegistry.html Record a startup fact for the "first reload this session" summary line. Once that line has been printed, a late note (e.g. a player connecting mid-session) is logged directly. ```APIDOC ## Method: NoteForFirstReload(string note) ### Description Record a startup fact for the "first reload this session" summary line. Once that line has been printed, a late note (e.g. a player connecting mid-session) is logged directly. ### Declaration ```csharp public static void NoteForFirstReload(string note) ``` ### Parameters - **note** (string) - Short clause, no trailing period, e.g. "3 reloadable method(s) registered". ### Returns Void. ``` -------------------------------- ### Connect to a Unity Editor with the unity CLI Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/connectivity.html Run `unity command` with no command name to auto-discover a Unity instance from the current directory and list its available commands. Use `--project-path` to connect to a specific project. ```bash # Auto-discover a Unity instance from the current directory unity command # Connect to a specific project unity command --project-path /path/to/your/unity/project ``` -------------------------------- ### wait_status Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/commands/wait.html Get the status/result of an async wait (wait_for with async=true). ```APIDOC ## wait_status ### Description Get the status/result of an async wait (`wait_for` with `async=true`). ### Parameters | Parameter | Required | Default | Description | |-----------|----------|---------|-------------| | `wait_id` | yes | `–` | The id returned by `wait_for` when `async=true`. | ### Returns `WaitResult` (`state:"not_found"` if the id is unknown — async waits do not survive a domain reload; completed waits are retained up to a bounded count and pruned oldest-first the next time a `wait_for` is submitted, so a session that never submits another wait keeps its last results queryable). ``` -------------------------------- ### MaterialCommands: create_material and set_material authoring commands Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/authoring-commands.html Complete C# implementation of two authoring commands for materials: create_material (asset creation, not undoable) and set_material (scene mutation with undo). Includes path resolution, shader lookup, ObjectRef resolution, and folder creation helper. ```csharp using System.IO; using Unity.Pipeline.Commands; using Unity.Pipeline.Editor.Authoring; using Unity.Pipeline.Models; using UnityEditor; using UnityEditor.SceneManagement; using UnityEngine; namespace Unity.Pipeline.Editor.Commands.Rendering { /// Authoring commands for materials (rendering). public static class MaterialCommands { [CliCommand("create_material", "Create a Material asset (default shader 'Standard') under the authoring root. " + "NOTE: asset creation is not undoable via Ctrl+Z.")] public static AuthoringResult CreateMaterial( [CliArg("path", "Asset path relative to the authoring root; the Assets/ prefix and the .mat extension are optional. e.g. Materials/Stone", Required = true)] string path, [CliArg("shader", "Shader name to assign. Defaults to 'Standard'.")] string shader = "Standard") { // 1. Resolve + confine the path (the sandbox boundary). var normalized = ProjectPaths.Resolve(path, out var error); if (normalized == null) throw new ArgumentException(error); if (!normalized.EndsWith(".mat", System.StringComparison.OrdinalIgnoreCase)) normalized += ".mat"; var found = Shader.Find(shader); if (found == null) throw new ArgumentException($"Shader '{shader}' was not found."); // 2. Do the work (AssetDatabase op — no undo scope; it wouldn't be undoable anyway). EnsureParentFolder(normalized); var material = new Material(found); AssetDatabase.CreateAsset(material, normalized); AssetDatabase.SaveAssets(); // 3. Return the created object's identity so the agent can reference it next. var result = ObjectResolver.Describe(material) ?? new AuthoringResult { Type = nameof(Material) }; result.AssetPath = normalized; return result; } [CliCommand("set_material", "Assign a material asset to a Renderer on a scene GameObject.")] public static AuthoringResult SetMaterial( [CliArg("target", "Handle of the GameObject (or Renderer) to modify.", Required = true)] ObjectRef target, [CliArg("material", "Handle of the material asset to assign (path/guid/globalId).", Required = true)] ObjectRef material) { // Resolve both handles up front, before mutating, so a bad handle changes nothing. var renderer = ResolveRenderer(target); if (!ObjectResolver.TryResolve(material, out var matObj, out var matError)) throw new ArgumentException(matError); if (matObj is not Material mat) throw new ArgumentException($"'{material}' is not a Material."); using (new AuthoringUndoScope("Set Material")) { Undo.RecordObject(renderer, "Set Material"); // record BEFORE the change renderer.sharedMaterial = mat; EditorSceneManager.MarkSceneDirty(renderer.gameObject.scene); } return ObjectResolver.Describe(renderer); } private static Renderer ResolveRenderer(ObjectRef target) { if (!ObjectResolver.TryResolve(target, out var obj, out var error)) throw new ArgumentException(error); var go = obj as GameObject ?? (obj as Component)?.gameObject; var renderer = go != null ? go.GetComponent() : null; if (renderer == null) throw new ArgumentException($"Object '{target}' has no Renderer."); return renderer; } // Mirrors the shared helper used by the built-in asset commands. private static void EnsureParentFolder(string assetPath) { var parent = Path.GetDirectoryName(assetPath)?.Replace('\\', '/'); if (string.IsNullOrEmpty(parent) || AssetDatabase.IsValidFolder(parent)) return; // Create intermediate folders (see create_folder / CreateFolderRecursive). Directory.CreateDirectory(ProjectPaths.ProjectRoot + "/" + parent); AssetDatabase.Refresh(); } } } ``` -------------------------------- ### CodeReloadRegistry.GetStats() Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.CodeReload.CodeReloadRegistry.html Gets statistics about current code reload state. ```APIDOC ## Method: GetStats() ### Description Gets statistics about current code reload state. ### Declaration ```csharp public static CodeReloadStats GetStats() ``` ### Parameters None. ### Returns - **CodeReloadStats** - Current reloadable/override/loaded-type counts. ``` -------------------------------- ### Build, Compilation & Test Commands Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/index.html Commands for building the Player, switching build targets, managing build settings, recompiling scripts, and running tests. ```APIDOC ## build ### Description Async Player build. Poll `build_status` for completion. ### Method Command ### Endpoint `build` ### Parameters None ### Response None ## build_status ### Description Status / report of the current build. ### Method Command ### Endpoint `build_status` ### Parameters None ### Response Build status/report. ## switch_build_target ### Description Switch the active build target. Requires confirmation. ### Method Command ### Endpoint `switch_build_target` ### Parameters None ### Response None ## switch_build_target_status ### Description Status of the last target switch. ### Method Command ### Endpoint `switch_build_target_status` ### Parameters None ### Response Status information. ## list_build_targets ### Description List known build targets. ### Method Command ### Endpoint `list_build_targets` ### Parameters None ### Response List of build targets. ## get_build_settings ### Description Read build configuration. ### Method Command ### Endpoint `get_build_settings` ### Parameters None ### Response Build configuration object. ## set_build_settings ### Description Set build configuration fields. ### Method Command ### Endpoint `set_build_settings` ### Parameters None ### Response None ## list_build_profiles ### Description List Build Profile assets (Unity 6). ### Method Command ### Endpoint `list_build_profiles` ### Parameters None ### Response List of build profiles. ## recompile ### Description Force a script recompile. Poll `recompile_status` for completion. ### Method Command ### Endpoint `recompile` ### Parameters None ### Response None ## recompile_status ### Description Status of the last recompile. ### Method Command ### Endpoint `recompile_status` ### Parameters None ### Response Status information. ## list_tests ### Description List available tests without running. ### Method Command ### Endpoint `list_tests` ### Parameters None ### Response List of tests. ## run_tests ### Description Run Unity tests with filters. ### Method Command ### Endpoint `run_tests` ### Parameters None ### Response None ## test_status ### Description Status of async test execution. ### Method Command ### Endpoint `test_status` ### Parameters None ### Response Test execution status. ## cancel_tests ### Description Cancel running tests. ### Method Command ### Endpoint `cancel_tests` ### Parameters None ### Response None ``` -------------------------------- ### runtime_status Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/commands/runtime.html Get comprehensive runtime application status. No parameters are required. ```APIDOC ## runtime_status ### Description Get comprehensive runtime application status. ### Parameters None. ### Returns `RuntimeStatusResponse` ### Notes `MainThreadRequired = true`, tagged `runtime`. ``` -------------------------------- ### GET /api/progress Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/commands/batch.html Retrieves per-operation progress for a running batch job. ```APIDOC ## GET /api/progress ### Description Retrieves per-operation progress for a running batch job. ### Method GET ### Endpoint /api/progress ### Parameters #### Query Parameters - **job_id** (string) - Required - Identifier of the job to query. ### Request Example GET /api/progress?job_id=abc123 ### Response #### Success Response (200) - **progress** (string) - Progress message, e.g., "op 1/10: create_asset". #### Response Example { "progress": "op 1/10: create_asset" } ``` -------------------------------- ### run_script Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/commands/scripts.html Compile a single project `.cs` file in memory and execute a named static entry point. This is the builder-pattern path for bulk construction, and is an Editor command that runs arbitrary code. ```APIDOC ## run_script ### Description Compile a single project `.cs` file in memory and execute a named static entry point. This is the builder-pattern path for bulk construction, and is an Editor command that runs arbitrary code. ### Parameters | Parameter | Required | Default | Description | |---|---|---|---| | `file` | yes | `–` | Path to a `.cs` file. Relative paths resolve against the project root (the parent of `Assets/`), not the process working directory. May live outside `Assets/` (e.g. `AgentScripts/`) so writing it never triggers an asset import or domain reload. | | `entry` | no | `–` | Entry point as `Namespace.Type.Method` (or `Type.Method`, or a bare `Method`). Nested types may be written with dots (`Outer.Inner.Method`). Default: the single public static method if unambiguous, else a method named `Main`. Static, non-generic methods only in v1. Ephemeral mode only — rejected with `mode=hotpatch`. | | `args` | no | `–` | JSON array of arguments, coerced to the entry's parameter types: primitives, enum names, `string[]`, and a string/object handle (`ObjectRef`) for `UnityEngine.Object` parameters. JSON `null` is only valid for reference-type and nullable parameters (never a silent `default(T)`). Ephemeral mode only — rejected with `mode=hotpatch`. | | `mode` | no | `ephemeral` | `ephemeral`: compile to an in-memory assembly, run the entry, discard. `hotpatch`: apply in-place `[CodeReload]` method replacements to already-loaded types (delegates to `reload_file`). | | `references` | no | `–` | Extra assembly name prefixes to reference. In the Editor all loaded assemblies are already referenced, so this is effectively a no-op there. Ephemeral mode only; **not applied** by hotpatch (the compile is `reload_file`'s). | | `defines` | no | `–` | Extra scripting define symbols, **appended to the project's active editor defines** (`EditorUserBuildSettings.activeScriptCompilationDefines`) — so `UNITY_EDITOR`, version and platform symbols are already set and sources behave like project code; your defines extend that set rather than replace it. Ephemeral mode only; **not applied** by hotpatch. | | `pdb` | no | `false` | Emit a portable PDB mapped to the source file so breakpoints bind. Ephemeral runs always emit source-mapped symbols so exception stack traces carry `file:line`. Compiles unoptimized. | | `timeout_ms` | no | `30000` | Timeout in milliseconds (governs the main-thread wait budget end-to-end, like `eval`). | | `dry_run` | no | `false` | Compile only: return diagnostics; the emitted assembly is **not loaded** into the domain and nothing executes (the response carries no `assemblyName`). Rejected with `mode=hotpatch` — a hotpatch "dry run" would still apply live method replacements. | ### Returns `RunScriptResponse` — `{ result, diagnostics, compileMs, executeMs, assemblyName }` on top of the standard envelope. The result carries no echo of the source (path + diagnostics only). Compile errors return full Roslyn diagnostics (with line/column) and execute nothing; runtime exceptions surface as structured errors with `file:line` mapped to the source file. ### Notes - `MainThreadRequired = true`. Editor command. - Executing runs always compile **unoptimized (Debug codegen)** so the emitted symbols keep full sequence points for `file:line` mapping — expect the generated code to run somewhat slower than regular project assemblies. - **Async entry points** (`async Task` / `Task`) are awaited to completion; `Task.Result` becomes the command result and exceptions in the async work surface as runtime errors. The await is **asynchronous** — the Editor main thread keeps pumping, so awaits that resume on Unity's main-thread context (`Task.Yield()`, `Task.Delay()`, Awaitable, …) work naturally; no `ConfigureAwait(false)` contortions are required. The wait is bounded by what remains of `timeout_ms`; on expiry the command returns a `Timeout` error and the task keeps running detached (its effects may still land), like an abandoned `eval`. - **hotpatch specifics:** `entry`, `args` and `dry_run` are rejected (Bad Request); `references` and `defines` are not applied. Path resolution follows `reload_file`, which probes under `Assets/` for bare filenames (unlike ephemeral's project-root resolution). Timing: `executeMs` carries the whole reload duration (compile + apply, not split by `reload_file`); `compileMs` is `0`. Advisory reload diagnostics are surfaced as severity-`warning` entries on success. - Under Unity's Mono runtime the in-memory assembly emitted by an executing `ephemeral` run is **not** collectible/unloadable, so each run retains one small assembly (the same behavior as `eval`); prefer a single builder entry over many tiny runs. `dry_run` loads nothing. ``` -------------------------------- ### CliCommandAttribute.Tags Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.Commands.CliCommandAttribute.html Gets or sets hierarchical tags for grouping and browsing commands. ```APIDOC ## Property: Tags ### Description Optional hierarchical tags used to group and browse commands. Path-style: a '/' separates tag from subtag (e.g. "assets", "assets/import"). Default: empty (untagged). ### Declaration ``` public string[] Tags { get; set; } ``` ### Property Value | Type | Description | |------|-------------| | string[] | | ``` -------------------------------- ### RuntimePipelineBuildInfo.Load() Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.Config.RuntimePipelineBuildInfo.html Loads the RuntimePipelineBuildInfo asset from Resources. Returns null if this is not a real build. ```APIDOC ## Load() ### Description Loads the RuntimePipelineBuildInfo asset from Resources. Returns null if this is not a real build. ### Method Load() ### Declaration public static RuntimePipelineBuildInfo Load() ### Returns - **RuntimePipelineBuildInfo** - The build-time-baked info, or null if this is not a real build. ``` -------------------------------- ### CommandExecutionInfo Constructor Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.CommandExecutionInfo.html Creates an instance of CommandExecutionInfo describing one finished interaction. ```APIDOC ## CommandExecutionInfo Constructor ### Description Creates an info describing one finished interaction. ### Declaration ```csharp public CommandExecutionInfo(string requestJson, string responseJson, CommandInfo command, bool success, long durationMs, JObject parameters = null) ``` ### Parameters - **requestJson** (string) - Raw request JSON, or null when there is no transaction. - **responseJson** (string) - Raw response JSON, or null alongside a null request. - **command** (CommandInfo) - The command that ran, or null when none did. - **success** (bool) - Whether the command reported success. - **durationMs** (long) - Milliseconds spent inside the command. - **parameters** (JObject) - The parameters the command was invoked with, or null. Optional. ``` -------------------------------- ### CliCommandAttribute.Name Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.Commands.CliCommandAttribute.html Gets the unique name of the command used for CLI execution. ```APIDOC ## Property: Name ### Description Unique name of the command for CLI execution. Used in "unity request command_name" syntax. ### Declaration ``` public string Name { get; } ``` ### Property Value | Type | Description | |------|-------------| | string | | ``` -------------------------------- ### ScriptCompileException.Diagnostics Property Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/IlInterpreter.ScriptCompileException.html Gets the compiler diagnostics that caused the compilation failure. ```APIDOC ## ScriptCompileException.Diagnostics Property ### Description Gets the compiler diagnostics that caused the compilation failure. ### Declaration public IReadOnlyList Diagnostics { get; } ### Property Value - **Type**: IReadOnlyList - The compiler diagnostics that failed the compilation. ``` -------------------------------- ### run_script Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/index.html Compiles a project .cs file in memory and runs a named static entry point. ```APIDOC ## run_script ### Description Compile a project `.cs` file in memory (no domain reload) and run a named static entry point — the builder-pattern path for bulk construction. ### Command `run_script` ### Parameters - **file** (string) - Required - The path to the .cs file. - **entryPoint** (string) - Required - The name of the static entry point method. ### Return Type - **result** (object) - The result of the entry point execution. ``` -------------------------------- ### Chain authoring commands: create_material and set_material Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/authoring-commands.html Shows two chained authoring commands: create_material produces a Material asset, then set_material applies it to a target. Each command outputs a JSON result with assetPath, guid, type, or instanceId and hierarchyPath. ```text create_material --path Materials/Stone --shader Standard → { "assetPath": "Assets/AgentWork/Materials/Stone.mat", "guid": "…", "type": "Material" } set_material --target '{"hierarchyPath":"/Ground"}' --material '{"path":"Assets/AgentWork/Materials/Stone.mat"}' → { "instanceId": …, "hierarchyPath": "/Ground", "type": "MeshRenderer" } ``` -------------------------------- ### BackUpSettingsFileForTesting() Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.Config.RuntimePipelineConfig.html Moves the authored settings file aside if it exists, returning the backup path for later restoration. Intended for test fixture setup. ```APIDOC ## BackUpSettingsFileForTesting() ### Description Moves the authored settings file aside, if one exists, so a test run can start from a clean slate without destroying it. Returns the backup path to pass to RestoreSettingsFileForTesting(string), or null if there was no file to back up. For test fixture setup only. ### Method BackUpSettingsFileForTesting ### Signature `public static string BackUpSettingsFileForTesting()` ### Returns - **string** - The backup path, or null if no file existed. ``` -------------------------------- ### occlusion_bake_status Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/commands/baking.html Gets the status of the last occlusion bake: idle, baking, or completed. ```APIDOC ## occlusion_bake_status ### Description Get the status of the last occlusion bake: idle | baking | completed. ### Returns `object` — the bake's status payload, or `{"status":"idle"}` before the first bake. ``` -------------------------------- ### RuntimePipelineServer(RuntimePipelineConfig) Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.RuntimePipelineServer.html Constructor that creates a server bound to the given runtime pipeline configuration. ```APIDOC ## RuntimePipelineServer(RuntimePipelineConfig) ### Description Creates a new RuntimePipelineServer instance bound to the provided runtime pipeline configuration. ### Constructor RuntimePipelineServer(RuntimePipelineConfig config) ### Parameters - **config** (RuntimePipelineConfig) - The runtime pipeline configuration. ### Declaration public RuntimePipelineServer(RuntimePipelineConfig config) ``` -------------------------------- ### navmesh_bake_status Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/commands/baking.html Get the status of the last NavMesh bake: idle | baking | completed. ```APIDOC ## navmesh_bake_status ### Description Get the status of the last NavMesh bake: idle | baking | completed. ### Returns `object` — the bake's status payload, or `{"status":"idle"}` before the first bake. ``` -------------------------------- ### lighting_bake_status Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/manual/commands/baking.html Get the status of the last lighting bake: idle | baking | completed. ```APIDOC ## lighting_bake_status ### Description Get the status of the last lighting bake: idle | baking | completed. ### Returns `object` — the bake's status payload, or `{"status":"idle"}` before the first bake. ``` -------------------------------- ### ProjectPaths.ProjectRoot Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.Editor.Authoring.ProjectPaths.html Gets the absolute path to the project root (the folder that contains Assets/). ```APIDOC ## Property: ProjectRoot ### Description Gets the absolute path to the project root (the folder that contains Assets/). ### Declaration ```csharp public static string ProjectRoot { get; } ``` ### Property Value - **Type**: string - **Description**: The absolute project root path. ``` -------------------------------- ### Load() Source: https://docs.unity3d.com/Packages/com.unity.pipeline%400.8/api/Unity.Pipeline.Config.RuntimePipelineConfig.html Loads the current settings, or null if none exist. In the Editor reads the authored JSON file; in a Player build reads the build-time-generated transient Resources asset. ```APIDOC ## Load() ### Description Load the current settings, or null if none exist yet. In the Editor (including Play Mode) this reads the authored ProjectSettings/ JSON file directly; in a real Player build it reads the build-time-generated transient Resources asset. ### Method Load ### Signature `public static RuntimePipelineConfig Load()` ### Returns - **RuntimePipelineConfig** - The current settings, or null if none exist yet. ```