run_cli
Runs one IOS command on a Packet Tracer device console, returning output and status. Handles long-running commands and interactive prompts.
Instructions
Type one IOS command at the console of a router or switch and return its output, including commands that take time such as ping or traceroute. status tells whether IOS accepted the command. A command still running after timeout_secs is stopped with Ctrl+Shift+6 and comes back with finished: false and the output so far. When IOS asks something ([confirm], [yes/no], Password:) the reply carries question and the console keeps waiting: answer with another run_cli in mode current, an empty command for Enter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Mode to run the command in. Defaults to `enable`. | |
| device | Yes | Device name exactly as shown by `list_devices`. | |
| command | Yes | One IOS command, for example `show ip interface brief`. To answer a question the previous command left open (`question` in its reply), send the answer here with mode `current`; an empty command presses Enter, which confirms `[confirm]`. | |
| password | No | Console line password, when the device asks for one at `Password:`. | |
| timeout_secs | No | Seconds to wait for the command to finish. Defaults to 30, maximum 300. | |
| enable_password | No | Privileged mode password (`enable secret` or `enable password`). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output | Yes | ||
| status | No | ||
| finished | Yes | ||
| question | No | The question the command is waiting on, such as `Proceed with reload? [confirm]`. Answer it with another call in `current` mode; an empty command presses Enter. |