MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / snapshot_save

Function snapshot_save

unity_cli/cli/commands/uitree.py:709–725  ·  view source on GitHub ↗

Save current UI tree as a named snapshot. Examples: u uitree snapshot save -p "PanelSettings" --name baseline

(
    ctx: typer.Context,
    panel: Annotated[str, typer.Option("--panel", "-p", help="Panel name")],
    name: Annotated[str, typer.Option("--name", help="Snapshot name")],
)

Source from the content-addressed store, hash-verified

707@snapshot_app.command("save")
708@handle_cli_errors
709def snapshot_save(
710 ctx: typer.Context,
711 panel: Annotated[str, typer.Option("--panel", "-p", help="Panel name")],
712 name: Annotated[str, typer.Option("--name", help="Snapshot name")],
713) -> None:
714 """Save current UI tree as a named snapshot.
715
716 Examples:
717 u uitree snapshot save -p "PanelSettings" --name baseline
718 """
719 from unity_cli.api.uitree_snapshot import SnapshotStore
720
721 _validate_snapshot_name(name)
722 context: CLIContext = ctx.obj
723 data = context.client.uitree.dump(panel=panel, format="json")
724 path = SnapshotStore().save(name, data)
725 print_success(f"Saved snapshot '{name}' to {path}")
726
727
728@snapshot_app.command("diff")

Callers

nothing calls this directly

Calls 5

SnapshotStoreClass · 0.90
print_successFunction · 0.90
_validate_snapshot_nameFunction · 0.85
dumpMethod · 0.80
saveMethod · 0.45

Tested by

no test coverage detected