Skills routeros-command-tree
📦

routeros-command-tree

Safe

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.

Supports: Claude Codex Code(CC)
📊 71 Adequate
1

Download the skill ZIP

2

Upload in Claude

Go to Settings → Capabilities → Skills → Upload skill

3

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

Safe
v2 • 4/16/2026

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.

1
Files scanned
329
Lines analyzed
0
findings
2
Total audits
No security issues found

Detected Patterns

Markdown Code Formatting Misidentified as Command ExecutionDocumentation Code Examples Misidentified as Network CallsMarkdown Links Misidentified as Path Traversal
Audited by: claude View Audit History →

Quality Score

38
Architecture
100
Maintainability
87
Content
32
Community
100
Security
91
Spec Compliance

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

Basic Command Tree Exploration
What are the available commands under /ip/firewall in RouterOS?
API Endpoint Mapping
Map the /interface/bridge commands to their corresponding REST API endpoints and HTTP verbs.
Argument Discovery
What arguments does the /ip/route/add command accept? Show me the syntax for each.
Schema Generation
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

Frequently Asked Questions

What is /console/inspect in RouterOS?
It is a REST API endpoint that exposes the RouterOS command hierarchy. You can query it to list children of any path or get help text for commands and arguments.
How do I avoid crashing the RouterOS REST server?
Skip syntax lookups for arguments inside subtrees containing: where, do, else, rule, command, on-error. These are scripting constructs that crash the inspect API when their arg nodes are queried.
Can I work without a live RouterOS device?
Yes. Set the INSPECTFILE environment variable to point to a cached inspect.json file. Tools like rest2raml support this for offline schema generation.
What is the difference between RAML and OpenAPI output?
Both represent the same command tree data. RAML 1.0 uses resource-oriented notation. OpenAPI 3.0 uses standard REST terminology with paths, methods, and request bodies.
Why does PUT create entries instead of PUT updating?
RouterOS REST API uses PUT for create operations. PATCH is used for updates. This is the opposite of standard REST conventions where PUT is idempotent update and POST is create.
How long does full tree traversal take?
Against a live router, full traversal takes many minutes due to thousands of sequential HTTP requests. With KVM-accelerated CHR it is faster but still time-consuming. Use cached inspect.json for development.

Developer Details

File structure

📄 SKILL.md