workspace/skills/pyats-network/SKILL.md
Network device automation via pyATS - run show commands, ping, apply config, learn config/logging, list devices, run Linux commands, execute dynamic tests on Cisco IOS-XE/NX-OS devices. Use when running CLI commands on routers or switches, checking interface status, applying configuration changes, or collecting device data via pyATS.
npx skillsauth add automateyournetwork/netclaw pyats-networkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
$PYATS_MCP_SCRIPT$PYATS_TESTBED_PATHPYATS_TESTBED_PATH=$PYATS_TESTBED_PATHUse the $MCP_CALL protocol handler to invoke MCP tools:
PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" TOOL_NAME 'ARGS_JSON'
pyats_list_devicesList all devices in the testbed with their properties: name, alias, type, OS, platform, connection types, credentials summary.
PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_list_devices '{}'
Use when: Starting any session — always list devices first to confirm connectivity and inventory.
pyats_run_show_commandExecute any show command with automatic Genie structured parsing. Returns parsed JSON when a Genie parser exists, raw text otherwise.
device_name (string): Target device from testbedcommand (string): Show command — must start with "show"PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_run_show_command '{"device_name":"R1","command":"show ip interface brief"}'
Validation rules:
|), redirects (>), or shell charactersshow running-config or show logging — use the dedicated toolsCommands with Genie parsers (structured JSON output) on IOS-XE:
Routing:
show ip route / show ip route vrf <name>show ip protocolsshow ip bgp / show ip bgp summary / show ip bgp neighborsshow ip ospf / show ip ospf neighbor / show ip ospf interface / show ip ospf databaseshow ip eigrp neighbors / show ip eigrp topologyshow isis neighbors / show isis databaseshow ip static routeInterfaces:
show ip interface brief / show ipv6 interface briefshow interfaces / show interfaces <name>show interfaces statusshow interfaces countersshow ip interfaceL2/Switching:
show vlan / show vlan briefshow spanning-tree / show spanning-tree detailshow mac address-tableshow etherchannel summaryNeighbors:
show cdp neighbors / show cdp neighbors detailshow lldp neighbors / show lldp neighbors detailFHRP:
show standby / show standby briefshow vrrp / show vrrp briefSystem:
show versionshow inventoryshow processes cpu / show processes cpu sortedshow processes memory / show processes memory sortedshow platformshow ntp associations / show ntp statusshow snmpshow clockshow bootflashshow licenseSecurity:
show access-lists / show ip access-listsshow crypto isakmp sa / show crypto ipsec sashow dot1xshow port-securityshow authentication sessionsQoS:
show policy-map / show policy-map interfaceVRF / MPLS:
show vrf / show vrf detailshow mpls forwarding-tableshow mpls ldp neighborOther:
show arpshow ip nat translationsshow ip dhcp bindingshow trackshow route-mapshow ip prefix-listshow bfd neighborsshow flow monitorpyats_configure_deviceApply configuration changes to a device. Automatically enters config mode and exits.
device_name (string): Target deviceconfig_commands (list of strings OR multiline string): Configuration linesPYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_configure_device '{"device_name":"R1","config_commands":["interface Loopback99","ip address 99.99.99.99 255.255.255.255","description NetClaw-Test","no shutdown"]}'
Rules:
configure terminal, conf t, or end — the tool handles mode transitionsexit commands when you need to return to a higher config contextwrite erase, erase, reload, delete, formatpyats_show_running_configRetrieve the full running configuration from a device.
device_name (string): Target devicePYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_show_running_config '{"device_name":"R1"}'
Use when: Capturing configuration baselines, auditing config, pre/post change verification.
pyats_show_loggingFetch system logs (last 250 entries) from a device.
device_name (string): Target devicePYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_show_logging '{"device_name":"R1"}'
Use when: Checking for errors, tracebacks, interface flaps, protocol events after changes.
pyats_ping_from_network_deviceExecute ping from the network device itself (not from the MCP client).
device_name (string): Source devicecommand (string): Ping command (e.g., ping 8.8.8.8, ping 10.0.0.1 repeat 100 source Loopback0)PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_ping_from_network_device '{"device_name":"R1","command":"ping 8.8.8.8"}'
Returns: Structured JSON with success rate %, RTT stats, packet loss when Genie parsing succeeds.
pyats_run_linux_commandExecute shell commands on Linux-based devices in the testbed.
device_name (string): Linux-capable devicecommand (string): Shell commandUse when: The testbed includes Linux hosts (containers, VMs) for system administration tasks.
pyats_run_dynamic_testExecute a complete pyATS AEtest validation script inline. The script runs in a sandboxed environment.
test_script_content (string): Complete Python AEtest scriptPYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_run_dynamic_test '{"test_script_content":"import logging\nfrom pyats import aetest\n\nlogger = logging.getLogger(__name__)\n\nTEST_DATA = {\"expected_interfaces\": [\"GigabitEthernet1\", \"Loopback0\"]}\n\nclass InterfaceTest(aetest.Testcase):\n @aetest.test\n def verify_interfaces(self):\n for intf in TEST_DATA[\"expected_interfaces\"]:\n logger.info(f\"Checking interface: {intf}\")\n assert intf.startswith(\"Gi\") or intf.startswith(\"Loop\"), f\"Unexpected interface type: {intf}\"\n\nif __name__ == \"__main__\":\n aetest.main()"}'
Rules:
TEST_DATA as a Python dict literal (not loaded from file/network)__import__(), eval(), exec(), compile(), open(), json.loads()Use when: Complex pass/fail validation, multi-step assertions, compliance checks on data already collected via show commands.
For operations beyond the 8 MCP tools, use pyATS directly:
from pyats.topology import loader
tb = loader.load('$PYATS_TESTBED_PATH')
device = tb.devices['R1']
device.connect(learn_hostname=True, log_stdout=False)
output = device.parse('show ip interface brief')
print(output)
device.disconnect()
from genie.testbed import load
testbed = load('$PYATS_TESTBED_PATH')
dev = testbed.devices['R1']
dev.connect(learn_hostname=True, log_stdout=False)
# Learn returns an OS-agnostic normalized data model
ospf = dev.learn('ospf') # Neighbors, interfaces, database, areas, LSAs
bgp = dev.learn('bgp') # Neighbors, address-families, routes, state
intf = dev.learn('interface') # All interfaces: status, IP, counters, MTU, speed
routing = dev.learn('routing') # Full routing table from all protocols
platform = dev.learn('platform') # Hardware, modules, images, slots
print(ospf.info)
dev.disconnect()
All 34 learnable features: acl, arp, bgp, config, device, dot1x, eigrp, fdb, hsrp, igmp, interface, isis, lag, lisp, lldp, mcast, mld, msdp, nd, ntp, ospf, pim, platform, prefix_list, rip, route_policy, routing, static_routing, stp, terminal, utils, vlan, vrf, vxlan.
from genie.utils.diff import Diff
# Capture before state
before = dev.learn('ospf')
# ... make changes ...
# Capture after state
after = dev.learn('ospf')
diff = Diff(before.info, after.info)
diff.findDiff()
print(diff) # Shows + additions and - deletions
testing
Human-in-the-loop escalation via HumanRail — route low-confidence agent decisions, pre-destructive operation approvals, and ambiguous incident tickets to real human engineers. Human answers are verified and returned as structured output. Workers are paid via Lightning Network. Use when the agent is uncertain, when a destructive change needs explicit human sign-off beyond a ServiceNow CR, or when an ambiguous ticket requires human triage before automated handling.
testing
Manage EVE-NG node lifecycle. Use when listing nodes, checking runtime state, creating or deleting nodes, starting or stopping nodes or whole labs, verifying node details, or wiping node NVRAM back to factory defaults.
development
Manage EVE-NG labs and platform inventory. Use when listing labs, checking lab metadata, creating or deleting labs, importing or exporting lab archives, checking EVE-NG health or auth, or verifying available node images before build work.
tools
Execute live CLI commands on running EVE-NG nodes over telnet console. Use when running show commands, making live config changes, verifying protocol state, testing connectivity, checking console readiness, or interacting with IOS, Junos, VPCS, EOS, or NX-OS nodes.