Loading...
Loading...
Bidirectional interactive terminal session tool for serial port terminals, SSH interactive shells, local shells, device consoles, AT/CLI menus, and interactive debugging that requires context retention; Triggered when users mention interactive terminals, serial port terminals, SSH terminals, opening shells, continuing to read output after sending commands, maintaining sessions, post-login operations, or menu-driven command lines, and also supports explicit invocation via /terminal.
npx skill4agent add zhinkgit/embeddedskills terminalserialsshserialsshterminalsend/readconfig.json{}start.embeddedskills/state.json.embeddedskills/state.jsonterminal_sessions--port--baudrate--host--nameterminal_sessions.embeddedskills/state.json| Subcommand | Purpose | Risk |
|---|---|---|
| Start a background interactive session | Medium |
| List existing sessions | Low |
| Query the status of a single session | Low |
| Write text or Hex data to the session | Medium |
| Read and clear the session output buffer | Low |
| Access the session in foreground line mode | Medium |
| Stop the session and clean up state | Medium |
| Backend | Applicable Scenarios | Dependencies |
|---|---|---|
| MCU UART console, AT commands, Bootloader menus, board CLI | |
| Linux development board interactive shells, continuous operations after login | OpenSSH client |
| Local temporary shells, REPL, CLI program interaction | Python standard library |
scripts/python# Start serial terminal
python scripts/terminal_session.py start serial --port COM11 --baudrate 115200 --name board
# Start SSH terminal, use Host alias from ~/.ssh/config
python scripts/terminal_session.py start ssh --host 1380-P904 --name devboard
# Start local Shell
python scripts/terminal_session.py start local --name local-shell
# Send a command line with appended CRLF
python scripts/terminal_session.py send board "help" --crlf
# Read output, wait up to 1 second
python scripts/terminal_session.py read board --timeout 1
# Access in foreground line mode
python scripts/terminal_session.py attach board
# Query and stop
python scripts/terminal_session.py list
python scripts/terminal_session.py status board
python scripts/terminal_session.py stop board.embeddedskills/state.jsonterminal_sessions{
"terminal_sessions": {
"board": {
"backend": "serial",
"tcp_port": 23145,
"pid": 1234,
"started_at": "2026-05-26T10:00:00+08:00"
}
}
}.embeddedskills/logs/terminal/{
"status": "ok",
"action": "read",
"summary": "Read 42 bytes",
"details": {
"session": "board",
"text": "help\r\n..."
}
}{
"status": "error",
"action": "send",
"error": {
"code": "session_unreachable",
"message": "Session unreachable, may have exited"
}
}sshserialserialsshlocalstartread --timeout 1sendread --timeout <seconds>stop--namereadattachserial~/.ssh/configsshpyserialssh