routeros-command-tree
Generate RouterOS API Schemas from Command Tree
Building tools that interact with RouterOS requires understanding the command hierarchy. This skill provides the knowledge to programmatically explore the RouterOS command tree via the /console/inspect API and generate RAML or OpenAPI schemas.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "routeros-command-tree". What are the child nodes under /system/script?
Expected outcome:
The /system/script path contains these commands:
- run (cmd) - Execute a script
- add (cmd) - Create a new script
- remove (cmd) - Delete a script
- set (cmd) - Modify script properties
- print (cmd) - List scripts
- export (cmd) - Export script source
Using "routeros-command-tree". How do I map the /ip/address CLI commands to REST API?
Expected outcome:
CLI to REST mapping:
- add → PUT /rest/ip/address (creates new entry)
- set → PATCH /rest/ip/address/{id} (updates existing)
- remove → DELETE /rest/ip/address/{id} (deletes entry)
- print → GET /rest/ip/address (lists all)
- get (single) → GET /rest/ip/address/{id}
Security Audit
SafeAll 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.
Detected Patterns
Quality Score
What You Can Build
Build API Documentation Tools
Generate comprehensive API documentation from the live RouterOS command tree for your specific RouterOS version.
Create Code Generation Templates
Use the command tree to generate typed client libraries or Terraform providers for RouterOS resources.
Explore Available Commands
Discover all available configuration options and their parameters for a specific RouterOS feature set.
Try These Prompts
What are the available commands under /ip/firewall in RouterOS?
Map the /interface/bridge commands to their corresponding REST API endpoints and HTTP verbs.
What arguments does the /ip/route/add command accept? Show me the syntax for each.
Generate an OpenAPI 3.0 schema for the /queue/simple resource based on the RouterOS command tree.
Best Practices
- Use INSPECTFILE environment variable for testing to avoid repeated live router queries during development
- Skip syntax lookups for arguments inside dangerous subtrees (where, do, else, rule, command, on-error) to prevent REST server crashes
- Cache inspect.json per RouterOS version since the command tree varies significantly between releases
Avoid
- Do not query syntax descriptions for every argument in a live router - this takes hours for full tree traversal
- Do not ignore dangerous paths - calling fetchSyntax on arg nodes in those subtrees terminates the HTTP server process
- Do not assume the tree is identical across RouterOS versions - always regenerate schemas for your target version