360 Secure SkillHub
360 安全技能中心

cli2skill

核心功能:将CLI工具的--help输出或MCP服务器转换为AI编码代理可用的Skill Markdown文件,支持预览解析元数据,提供多种生成方式,无持久进程与内存泄漏。典型场景:替换无状态MCP服务器避免进程泄漏,无需手动编写Skill即可让AI代理用CLI工具,迁移有僵尸进程的MCP服务器。输入为CLI命令或MCP配置,输出为规范Skill文件。

2233admin
2233admin
热度 78.45
最近更新 2026-08-04 04:36:25
分类:开发依赖:代码执行 / 读写文件应用场景:API 集成 / 自动化脚本 / DevOps / 模板

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add cli2skill
Metadata
name
cli2skill
description
Turn any CLI or MCP server into an Agent Skill. Use when you want to replace an MCP server with a zero-overhead CLI skill, or generate a skill from any command-line tool's --help output.

cli2skill

Convert CLI tools and MCP servers into Agent Skills (markdown files) that any AI coding agent can use. Zero runtime overhead — no persistent processes, no memory leaks.

Prerequisites

pip install cli2skill

Commands

Generate skill from CLI

# Basic — parse --help and generate SKILL.md
cli2skill generate <executable> --name <skill-name> -o ~/.claude/skills/

# Custom executable path
cli2skill generate "python my_tool.py" --name my-tool \
  --exe-path "python /full/path/my_tool.py" -o ~/.claude/skills/

# From saved help text
cli2skill generate mytool --help-file help_output.txt -o ~/.claude/skills/

# Skip subcommand parsing (faster, top-level only)
cli2skill generate gh --name github-cli --no-subcommands -o ~/.claude/skills/

Preview parsed metadata

cli2skill preview <executable>

Convert MCP server to skill

# From command
cli2skill mcp npx some-mcp-server --name my-mcp -o ~/.claude/skills/

# From Claude Code settings.json
cli2skill mcp --config ~/.claude/settings.json --server my-server --name my-mcp -o ~/.claude/skills/

# With env vars
cli2skill mcp npx tavily-mcp --name tavily --env API_KEY=xxx -o ~/.claude/skills/

When to use

  • You have an MCP server that's just "call -> return result" with no persistent state — replace it with a CLI skill to eliminate process leaks
  • You want to give your agent access to any CLI tool without writing a skill by hand
  • You're migrating away from MCP servers that accumulate zombie processes

When NOT to use

  • MCP servers that need persistent browser sessions, streaming notifications, or multi-client shared state — those genuinely need MCP