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
CODEBLOCK0
Commands
Generate skill from CLI
CODEBLOCK1
Preview parsed metadata
CODEBLOCK2
Convert MCP server to skill
CODEBLOCK3
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
cli2skill
将CLI工具和MCP服务器转换为任何AI编程智能体都能使用的Agent技能(markdown文件)。零运行时开销——无持久进程,无内存泄漏。
前置条件
bash
pip install cli2skill
命令
从CLI生成技能
bash
基础用法——解析--help并生成SKILL.md
cli2skill generate <可执行文件> --name <技能名称> -o ~/.claude/skills/
自定义可执行文件路径
cli2skill generate python my_tool.py --name my-tool \
--exe-path python /full/path/my_tool.py -o ~/.claude/skills/
从保存的帮助文本生成
cli2skill generate mytool --help-file help_output.txt -o ~/.claude/skills/
跳过子命令解析(更快,仅解析顶层命令)
cli2skill generate gh --name github-cli --no-subcommands -o ~/.claude/skills/
预览解析后的元数据
bash
cli2skill preview <可执行文件>
将MCP服务器转换为技能
bash
从命令转换
cli2skill mcp npx some-mcp-server --name my-mcp -o ~/.claude/skills/
从Claude Code的settings.json转换
cli2skill mcp --config ~/.claude/settings.json --server my-server --name my-mcp -o ~/.claude/skills/
带环境变量
cli2skill mcp npx tavily-mcp --name tavily --env API_KEY=xxx -o ~/.claude/skills/
适用场景
- - 你有一个仅执行调用→返回结果且无持久状态的MCP服务器——用CLI技能替换它以消除进程泄漏
- 你想让智能体访问任何CLI工具,但不想手动编写技能
- 你正在迁移,远离那些会累积僵尸进程的MCP服务器
不适用场景
- - 需要持久浏览器会话、流式通知或多客户端共享状态的MCP服务器——这些场景确实需要MCP