Skip to content

Commit 0dd22dc

Browse files
committed
fix(cli): rewire prefab save to use manage_editor save_prefab_stage
The CLI `prefab save` command was routing to manage_prefabs with action=save_open_stage, which has no C# handler. Rewire it to manage_editor action=save_prefab_stage which was added in this PR. Removed the --force flag since the C# implementation always marks dirty before saving (MarkSceneDirty + SaveScene).
1 parent 242548b commit 0dd22dc

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

Server/src/cli/commands/prefab.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,32 +68,24 @@ def close_stage(save: bool):
6868

6969

7070
@prefab.command("save")
71-
@click.option(
72-
"--force", "-f",
73-
is_flag=True,
74-
help="Force save even if no changes detected. Useful for automated workflows."
75-
)
7671
@handle_unity_errors
77-
def save_stage(force: bool):
72+
def save_stage():
7873
"""Save the currently open prefab stage.
7974
8075
\b
8176
Examples:
8277
unity-mcp prefab save
83-
unity-mcp prefab save --force
8478
"""
8579
config = get_config()
8680

8781
params: dict[str, Any] = {
88-
"action": "save_open_stage",
82+
"action": "save_prefab_stage",
8983
}
90-
if force:
91-
params["force"] = True
9284

93-
result = run_command("manage_prefabs", params, config)
85+
result = run_command("manage_editor", params, config)
9486
click.echo(format_output(result, config.format))
9587
if result.get("success"):
96-
print_success("Saved prefab")
88+
print_success("Saved prefab stage")
9789

9890

9991
@prefab.command("info")

0 commit comments

Comments
 (0)