cli-manager

Manages persistence of user-installed third-party CLI tools across sandbox sessions.

5.0k|557|Updated May 14, 2025
One-click install
npx skills add https://github.com/dtyq/magic --skill cli-manager
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-manager
Source: https://github.com/dtyq/magic/tree/main/backend/super-magic/agents/skills/cli-manager
Command: npx skills add https://github.com/dtyq/magic --skill cli-manager

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CLI tools installed inside a sandboxed environment disappear when the sandbox is destroyed, forcing users to reinstall and reconfigure them every session. This Skill orchestrates installing, persisting, restoring, inspecting, and removing user-managed CLI tools so they survive across sandbox sessions.

Core Features & Use Cases

  • Persistent CLI Installation: Installs third-party CLIs (via npm, pipx, uv, go, cargo, brew, or script installers) and persists them so they remain available in future sandbox sessions.
  • Adopt, Inspect, and Remove: Adopts already-installed CLIs into persistence records, lists and validates persisted CLIs, and removes persistence records or saved state after user confirmation.
  • Runtime CLI Protection: Distinguishes runtime-provided CLIs (lark-cli, dws, teamshare-cli) from user-managed ones and prevents accidental persistence or modification of runtime tools.
  • Use Case: A user wants to install a code-generation CLI with npm install -g and keep it available next week. The Skill reviews the installer, asks for confirmation, persists the CLI with its config directories and environment variable names, and restores it automatically in later sessions.

Quick Start

Install the example-cli tool with npm and persist it so it stays available in all my future sandbox sessions.

Frequently Asked Questions about cli-manager

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I persist a CLI tool installed in a sandbox environment?

Identify the CLI name, install command, config directories, and required environment variables, then confirm persistence with the user and call cli_manager_apply in install mode. The tool executes the installer and records persistence so the CLI is restored in future sandbox sessions.

How do I keep an already installed CLI available across sessions?

Use cli_manager_apply with mode set to adopt, providing the CLI's command names, config directories, and environment variable names. This creates a persistence record for the existing installation without rerunning the installer.

Can I persist runtime-provided CLIs like lark-cli or dws?

No. Runtime-provided CLIs such as lark-cli, dws, and teamshare-cli are managed by the sandbox runtime and must never be installed, adopted, or persisted through cli-manager. If one is unavailable, report it as a runtime environment problem instead.

Is it safe to persist CLIs installed with curl pipe to shell scripts?

Only after reading the full installer script first and confirming there is no obvious high-risk behavior. The Skill requires reviewing script-based installers like curl | sh or sh install.sh before proceeding, and cli_manager_apply executes the installer rather than shell_exec.

What happens when a CLI install conflicts with an existing command?

The conflict is reported in result.content and shown to the user, who chooses to adopt the existing command, replace the persisted CLI, use a different command name, or cancel. Nothing is overwritten, deleted, or renamed without explicit user choice.

Where are API keys and secrets for persisted CLIs stored?

Secret values such as API keys, tokens, and licenses are stored with the env-manager skill, not cli-manager. Cli-manager only records the names of required environment variables so missing values can be flagged after installation.