Manage persistence for user-installed third-party CLI tools in the Super Magic sandbox. Use when the user wants to install, configure, adopt, restore, inspect, or remove a CLI, or when an external skill, webpage, or installer asks to run CLI install commands such as curl|sh, npm install -g, pipx install, uv tool install, go install, cargo install, or brew install. Do not persist runtime-provided CLIs.
77
96%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
Use this skill when the user wants to install a user-managed third-party CLI, or when a user-installed CLI should remain available across future sandbox sessions.
This skill is for orchestration only. Do not handle installed artifacts yourself, and do not guess how the tool implements persistence. All persistence, restore, conflict detection, and cleanup actions must go through the Code Mode tools.
lark-cli, dws, and teamshare-cli are provided and updated by the Super Magic runtime. Never install, adopt, or create new persistence records for them with cli-manager.cli_manager_list lists only user-managed persisted CLIs. An empty result says nothing about runtime-provided CLIs.curl ... | sh, wget ... | bash, or sh install.sh, read the full installer script first and continue only if there is no obvious high-risk behavior.env-manager. This skill only records environment variable names.result.content.extra_info, data, or other internal fields unless a later tool document explicitly requires it.resolution, resolution_options, or other guessed internal parameters.shell_exec. cli_manager_apply is responsible for executing the installer after confirmation.lark-cli, dws, or teamshare-cli, follow the runtime-provided short circuit above and stop this install flow.cli_manager_apply.env-manager to check or save the required environment variable before continuing.result.content.cli_manager_apply fails, do not run the CLI with shell_exec to turn the flow into a success. Follow the next steps in result.content or report that persistence did not complete.Install a new CLI:
run_sdk_snippet(python_code="""
from sdk.tool import tool
result = tool.call("cli_manager_apply", {
"name": "example-cli",
"mode": "install",
"install_command": "npm install -g example-cli",
"commands": ["example-cli"],
"config_dirs": ["~/.example-cli"],
"env_keys": ["EXAMPLE_API_KEY"],
"confirmed": True,
})
if not result.ok:
print(result.content)
raise SystemExit(1)
print(result.content)
""")Adopt an already installed CLI:
run_sdk_snippet(python_code="""
from sdk.tool import tool
result = tool.call("cli_manager_apply", {
"name": "example-cli",
"mode": "adopt",
"commands": ["example-cli"],
"config_dirs": ["~/.example-cli"],
"env_keys": [],
"confirmed": True,
})
if not result.ok:
print(result.content)
raise SystemExit(1)
print(result.content)
""")When the user wants to inspect persisted CLIs, check whether restore succeeded, or diagnose an unavailable command, call cli_manager_list.
run_sdk_snippet(python_code="""
from sdk.tool import tool
result = tool.call("cli_manager_list", {"validate": True})
if not result.ok:
print(result.content)
raise SystemExit(1)
print(result.content)
""")Only remove a persisted CLI after explicit user confirmation. By default, remove only the CLI persistence. Set remove_state=True only when the user explicitly asks to also delete that CLI's saved state.
run_sdk_snippet(python_code="""
from sdk.tool import tool
result = tool.call("cli_manager_remove", {
"name": "example-cli",
"remove_state": False,
"confirmed": True,
})
if not result.ok:
print(result.content)
raise SystemExit(1)
print(result.content)
""")When a conflict occurs, do not overwrite, delete, or rename anything yourself. Read result.content, show the conflict to the user, and ask them to choose one of the next steps.
If the user chooses to adopt an existing command, call cli_manager_apply again with mode="adopt" and the same command names.
If the user chooses to replace an existing persisted CLI, call cli_manager_remove first after confirmation, then retry cli_manager_apply.
If the user chooses to replace a command that is outside cli-manager, ask before removing anything and retry only after the conflict is gone.
If the user chooses a different command name, make sure it is a real command name or an installer-supported alias before retrying.
If the user cancels, stop the flow and report that no persistence change was made.
Do not pass resolution, resolution_options, preferred_strategy, command_paths, or extra_bin_dirs. They are not orchestration inputs.
After success, briefly tell the user:
f9973c5
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.