Netmiko-Skripte oder JackedIN: Wann welches Tool für KI-Agenten passt
Der Entwickler von JackedIN erläutert, wann ein einfaches Netmiko- oder scrapli-Skript genügt und wann eine Kombination aus GUI, CLI und MCP-Server auf einer Engine besser geeignet ist. Beschrieben wird Version 1.2.1, eine Freigabe durch Menschen vor Änderungen ist dort noch nicht enthalten.

Offenlegung: Ich entwickle JackedIN. Dieser Artikel behandelt die Frage, wann ein Netmiko- oder scrapli-Skript bereits das richtige Werkzeug ist und wann eine Kombination aus GUI, CLI und MCP-Server auf einer Engine besser zu einem KI-Agenten passt. Er beschreibt JackedIN 1.2.1. Eine menschliche Freigabe vor jeder Änderung kommt in der nächsten Version; sie ist nicht in 1.2.1 enthalten.
Verwenden Sie diese Beispiele nur auf Geräten, die Ihnen gehören oder die Sie verwalten dürfen. Hosts und Namen unten sind Platzhalter: 192.0.2.10 und router1. Halten Sie Passwörter aus der Kommandozeile fern.
Das ist die erste Tatsache, und sie sollte die erste Tatsache bleiben.
Netmikos send_command ist ein musterbasierter Aufruf. Die offizielle Dokumentation sagt, dass es standardmäßig "weiter auf den Empfang von Daten wartet, bis der Prompt des Netzwerkgeräts erkannt wird". Der aktuelle Prompt wird automatisch bestimmt. Übergeben Sie expect_string, wenn Sie ein anderes Muster für das Ende der Ausgabe benötigen. ( Netmiko BaseConnection.send_command )
from netmiko import ConnectHandler conn = ConnectHandler ( device_type = "juniper_junos", host = "192.0.2.10", username = "admin", ) print ( conn. send_command ( "show version" ) ) conn. disconnect ( ) Vollbildmodus öffnen Vollbildmodus verlassen Auch scrapli wartet nach einem Befehl auf den konfigurierten Prompt. Telnet ist neben SSH ein dokumentierter Transport in der offiziellen Dokumentation: Scrapli.
Wenn ein Python-Playbook diese Bibliotheken bereits nutzt und zuverlässig arbeitet, behalten Sie es. JackedIN ist nicht das erste Werkzeug, das in Python auf einen Prompt wartet, und es ersetzt Netmiko oder scrapli nicht Funktion für Funktion (Abdeckung von Gerätetypen, TextFSM/Genie-Parsing und der Rest dieses Ökosystems bleiben bei diesen Bibliotheken).
Das schwächere Muster ist das Weiterreichen von Befehlen an rohes ssh, plink oder ein nacktes serielles pty mit anschließendem Sleep. Ein Dateiende kann die Sitzung schließen, während router1 noch auf --More-- steht, oder nachdem das Gerät einen Fehler ausgegeben hat, den der Agent nie gelesen hat. Netmiko und scrapli lösen das in Python bereits. Die verbleibende Lücke ist operativ: Das Terminal des Operators, ein einmaliges CLI und der Agent sind oft drei verschiedene Stacks, und Serial ist ein Nachgedanke, wenn SSH ausgefallen ist.
JackedIN ist ein SSH-, Telnet- und serielles Terminal für Windows, Linux und Raspberry Pi (einen macOS-Build gibt es noch nicht). Dasselbe Programm ist das Desktop-Fenster, der jackedin-Befehl, eine lokale API und ein stdio-MCP-Server. Eingebaute Profile für Junos, Cisco IOS/NX-OS, Arista, Nokia, MikroTik und weitere. Getestet auf echter Juniper-Hardware.
jackedin exec liest zuerst die Befehlsliste, sendet einen Befehl, wartet, bis der Geräte-Prompt zurück ist, blättert durch --More--, ---(more)--- und ähnliche Markierungen und gibt dann optional JSON aus.
jackedin exec --host 192.0.2.10 --user admin --trust-host-key \ --json --cmd "show version" Vollbildmodus öffnen Vollbildmodus verlassen Fangen Sie unter Windows diese Ausgabe mit jackedin.com ab, nicht mit jackedin.exe. Setzen Sie JACKEDIN_PASSWORD, statt ein Passwort-Flag zu übergeben.
--json (gleich wie --output json ) liefert strukturierte Felder für jeden Befehl, einschließlich command, ok, output, prompt und timed_out. ok ist false, wenn ein Befehl, ein Timeout oder eine Verify-Prüfung fehlgeschlagen ist.
jackedin exec --serial COM3 --baud 9600 --user admin \ --json --cmd "show version" Vollbildmodus öffnen Vollbildmodus verlassen Unter Linux ist der Gerätepfad /dev/ttyUSB0 oder ein /dev/serial/by-id/...-Symlink. Serial nutzt standardmäßig 9600 8N1, ohne Flusssteuerung und mit einer Zeilenverzögerung von 100 ms, sofern Sie nicht --line-delay setzen. Netmiko hat ebenfalls Serial-Login-Helfer ( device_type-Werte, die _serial enthalten, plus serial_login ). Der Unterschied ist, dass JackedIN Serial dieselbe Binärdatei ist wie das Fenster und wie jackedin mcp, sodass ein Agent die Out-of-Band-Konsole ohne zweite Bibliothek nutzen kann.
jackedin mcp ist ein stdio-MCP-Server für die lokale API. Er wählt ausschließlich 127.0.0.1. Die API bleibt ausgeschaltet, bis Sie sie in den Einstellungen aktivieren, und sie erfordert ein Bearer-Token. Zu den Tools gehören exec, open_session und send_break. Das ist der Weg für Cursor oder Claude Desktop: der Agent ruft dieselbe prompt-gesteuerte Engine auf, die Sie bereits im Tab sehen.
Wenn Sie in Python bleiben möchten, installieren Sie pip install jackedin und rufen Sie dasselbe Programm auf:
from jackedin import Jackedin device = Jackedin ( "192.0.2.10", username = "admin" ) report = device. run ( [ "show version" ] ) print ( report. commands [ 0 ]. output ) Vollbildmodus öffnen Vollbildmodus verlassen Eine gespeicherte Sitzung ist Jackedin.from_session("router1"). dry_run gibt den Plan aus und verbindet sich nicht. Die Python-Pakete sind kostenlos; sie benötigen die JackedIN-App (72-stündige Testphase mit vollem Umfang, danach eine Lizenz). Es gibt außerdem einen Netmiko-artigen JackedinDevice-Adapter ( send_command, send_config_set ) für Skripte, die die Klasse wechseln möchten. Betrachten Sie ihn als Adapter, nicht als vollständigen Netmiko-Ersatz.
Nicht in 1.2.1: In KI-Sitzungen laufen show-Befehle frei; ein Befehl, der etwas ändert, läuft erst, nachdem ein Mensch ihn freigibt; der Agent kann eine Änderung nicht selbst freigeben. Bis das ausgeliefert ist, behandeln Sie exec so, dass es jeden Befehl senden kann, den Sie zulassen, und beschränken Sie den Agenten darüber, wie Sie ihn anweisen und welche Tools Sie aktivieren.
JackedIN kostet 19 Dollar als Einmalzahlung nach einer 72-stündigen Testphase mit vollem Umfang, eine Lizenz pro Computer: https://getpathprobe.com/jackedin/
Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.
Original (Englisch) anzeigen
Disclosure: I build JackedIN. This article is about when a Netmiko or scrapli script is already the right tool, and when a GUI, CLI, and MCP server on one engine is a better fit for an AI agent. It describes JackedIN 1.2.1. Human approval before any change is coming in the next release; it is not in 1.2.1.
Use these examples only on devices you own or are allowed to manage. Hosts and names below are placeholders: 192.0.2.10 and router1. Keep passwords out of the command line.
That is the first fact, and it should stay the first fact.
Netmiko's send_command is a pattern-based call. The official documentation says that, by default, it "will keep waiting to receive data until the network device prompt is detected." The current prompt is determined automatically. Pass expect_string when you need a different end-of-output pattern. ( Netmiko BaseConnection.send_command )
from netmiko import ConnectHandler conn = ConnectHandler ( device_type = "juniper_junos", host = "192.0.2.10", username = "admin", ) print ( conn. send_command ( "show version" ) ) conn. disconnect ( ) Enter fullscreen mode Exit fullscreen mode Scrapli likewise waits for the configured prompt after a command. Telnet is a documented transport, alongside SSH, in the official docs: Scrapli.
If a Python playbook already uses these libraries, and it is reliable, keep it. JackedIN is not the first tool that waits for a prompt in Python, and it does not replace Netmiko or scrapli feature-for-feature (device-type coverage, TextFSM/Genie parsing, and the rest of that ecosystem stay with those libraries).
The weaker pattern is piping commands into raw ssh, plink, or a bare serial pty, then sleeping. End-of-file can close the session while router1 is still on --More--, or after the device printed an error the agent never read. Netmiko and scrapli already solve that in Python. The remaining gap is operational: the operator's terminal, a one-off CLI, and the agent are often three different stacks, and serial is an afterthought when SSH is down.
JackedIN is an SSH, Telnet, and serial terminal for Windows, Linux, and Raspberry Pi (there is no macOS build yet). The same program is the desktop window, the jackedin command, a local API, and a stdio MCP server. Built-in profiles for Junos, Cisco IOS/NX-OS, Arista, Nokia, MikroTik and more. Tested on real Juniper hardware.
jackedin exec reads the command list first, sends one command, waits until the device prompt is back, pages through --More--, ---(more)---, and similar markers, then optionally prints JSON.
jackedin exec --host 192.0.2.10 --user admin --trust-host-key \ --json --cmd "show version" Enter fullscreen mode Exit fullscreen mode On Windows, capture that output with jackedin.com, not jackedin.exe. Set JACKEDIN_PASSWORD instead of passing a password flag.
--json (same as --output json ) returns structured fields for each command, including command, ok, output, prompt, and timed_out. ok is false if a command, timeout, or verify check failed.
jackedin exec --serial COM3 --baud 9600 --user admin \ --json --cmd "show version" Enter fullscreen mode Exit fullscreen mode On Linux the device path is /dev/ttyUSB0 or a /dev/serial/by-id/... symlink. Serial defaults to 9600 8N1, no flow control, and a 100 ms line delay unless you set --line-delay. Netmiko also has serial login helpers ( device_type values that contain _serial, plus serial_login ). The difference is that JackedIN serial is the same binary as the window and as jackedin mcp, so an agent can use the out-of-band console without a second library.
jackedin mcp is a stdio MCP server for the local API. It dials 127.0.0.1 only. The API stays off until you enable it in Settings, and it requires a Bearer token. Tools include exec, open_session, and send_break. That is the path for Cursor or Claude Desktop: the agent calls the same prompt-gated engine you already see in the tab.
If you want to stay in Python, pip install jackedin and call the same program:
from jackedin import Jackedin device = Jackedin ( "192.0.2.10", username = "admin" ) report = device. run ( [ "show version" ] ) print ( report. commands [ 0 ]. output ) Enter fullscreen mode Exit fullscreen mode A saved session is Jackedin.from_session("router1"). dry_run prints the plan and does not connect. The Python packages are free; they need the JackedIN app (72-hour full trial, then a license). There is also a Netmiko-style JackedinDevice adapter ( send_command, send_config_set ) for scripts that want to switch classes. Treat it as an adapter, not as a complete Netmiko replacement.
Not in 1.2.1: in AI sessions, show-type commands run freely; a command that changes something runs only after a human approves it; the agent cannot approve a change itself. Until that ships, treat exec as able to send any command you allow, and limit the agent by how you prompt it and which tools you enable.
JackedIN is $19 one-time after a 72-hour full trial, one license per computer: https://getpathprobe.com/jackedin/