routeros-command-tree
从命令树生成 RouterOS API Schema
构建与 RouterOS 交互的工具需要了解命令层级结构。本技能提供了通过 /console/inspect API 以编程方式探索 RouterOS 命令树并生成 RAML 或 OpenAPI schema 的知识。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“routeros-command-tree”。 /system/script 下的子节点有哪些?
预期结果:
/system/script 路径包含以下命令:
- run (cmd) - 执行脚本
- add (cmd) - 创建新脚本
- remove (cmd) - 删除脚本
- set (cmd) - 修改脚本属性
- print (cmd) - 列出脚本
- export (cmd) - 导出脚本源码
正在使用“routeros-command-tree”。 如何将 /ip/address CLI 命令映射到 REST API?
预期结果:
CLI 到 REST 映射:
- add → PUT /rest/ip/address(创建新条目)
- set → PATCH /rest/ip/address/{id}(更新现有条目)
- remove → DELETE /rest/ip/address/{id}(删除条目)
- print → GET /rest/ip/address(列出所有)
- get(单个)→ GET /rest/ip/address/{id}
安全审计
安全All 138 static findings are false positives. The skill is a documentation file containing markdown with code examples. The static scanner incorrectly flagged markdown syntax (backticks for code formatting), documentation code snippets (fetch examples), relative markdown links, and misinterpreted documentation text as security issues. No executable code exists in this skill.
检测到的模式
质量评分
你能构建什么
构建 API 文档工具
从实时 RouterOS 命令树生成全面的 API 文档,适用于您特定的 RouterOS 版本。
创建代码生成模板
使用命令树生成类型化的客户端库或 RouterOS 资源的 Terraform Provider。
探索可用命令
发现特定 RouterOS 功能集的所有可用配置选项及其参数。
试试这些提示
RouterOS 中 /ip/firewall 下有哪些可用命令?
将 /interface/bridge 命令映射到它们对应的 REST API 端点和 HTTP 动词。
/ip/route/add 命令接受哪些参数?请展示每个参数的语法。
基于 RouterOS 命令树为 /queue/simple 资源生成 OpenAPI 3.0 schema。
最佳实践
- 在开发过程中使用 INSPECTFILE 环境变量进行测试,避免重复的实时路由器查询
- 跳过危险子树(where、do、else、rule、command、on-error)内参数的语法查找,以防止 REST 服务器崩溃
- 按 RouterOS 版本缓存 inspect.json,因为命令树在不同版本之间差异显著
避免
- 不要在实时路由器上查询每个参数的语法描述——完整树遍历需要数小时
- 不要忽略危险路径——在这些子树中对 arg 节点调用 fetchSyntax 会终止 HTTP 服务器进程
- 不要假设树在不同 RouterOS 版本之间是相同的——始终为目标版本重新生成 schema