Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
zhinkgit avatar

Terminal

  • 268 installs
  • 534 repo stars
  • Updated June 29, 2026
  • zhinkgit/embeddedskills

terminal is an agent skill that opens and drives named bidirectional serial, SSH, or local shell sessions for embedded debugging and device CLIs.

About

terminal is an agent skill from embeddedskills that gives Claude Code and similar agents a managed, bidirectional terminal layer for embedded and systems work. Instead of one-off shell snippets, you start a named background session for a serial port, SSH host, or local shell, then drive it with send, read, and foreground attach flows while logs and PID metadata stay in the workspace. Solo and indie builders shipping firmware, IoT prototypes, or CLI-heavy tooling use it when menus, AT command sequences, or long-running device consoles need the same session across many agent turns. It fits the Build integrations shelf because the first hard need is wiring the agent to real hardware during development; the same pattern carries into Ship testing and Operate infra when you SSH into field devices or tail console output. Requires Python 3, optional pyserial for UART, and a normal OpenSSH client for SSH backends.

  • Starts background interactive sessions with stable names and read/write buffers
  • Three backends: serial (pyserial), SSH (OpenSSH), and local shell (PowerShell or $SHELL)
  • Send plain text or hex, drain output, attach foreground line mode, then stop and clean state
  • Persists sessions in `.embeddedskills/state.json` with per-session logs under `.embeddedskills/logs/terminal/`
  • CLI flags override saved session state; empty `config.json` keeps credentials and ports explicit per `start`

Terminal by the numbers

  • 268 all-time installs (skills.sh)
  • +22 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #180 of 550 CLI & Terminal skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/zhinkgit/embeddedskills --skill terminal

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs268
repo stars534
Last updatedJune 29, 2026
Repositoryzhinkgit/embeddedskills

What it does

Run named bidirectional serial, SSH, or local shell sessions from your coding agent while flashing firmware, driving AT commands, or debugging embedded boards.

Who is it for?

Best when you're doing firmware bring-up, UART/AT debugging, or repeated SSH into boards and servers from Claude Code or Cursor.

Skip if: Pure browser or API-only apps with no serial/SSH/local-shell needs, or anyone who only needs a single non-interactive command without session state.

When should I use this skill?

Use $terminal to open and drive a bidirectional serial, SSH, or local terminal session (default prompt from skill interface).

What you get

You get a named background terminal with buffered I/O, session logs, and cleanup hooks so the agent can interact with boards and shells predictably until you stop the session.

  • Named background terminal session with buffered send/read
  • Per-session log file under `.embeddedskills/logs/terminal/`
  • Updated `.embeddedskills/state.json` `terminal_sessions` entries until stopped

By the numbers

  • 3 session backends: serial, SSH, and local shell
  • Session metadata stored under `.embeddedskills/state.json` in `terminal_sessions`

Files

SKILL.mdMarkdownGitHub ↗

Terminal — 双向交互终端会话

统一封装串口、SSH 和本地 Shell 的双向交互会话。它补齐 serial 的“监控/发送是分离命令”和 ssh 的“远程命令多为一次性执行”之间的空白:当目标需要保持登录状态、菜单状态、REPL 状态或设备 CLI 上下文时,使用本 skill。

定位

  • serial:扫描、监控、单次发送、日志、Hex 查看。
  • ssh:OpenSSH 配置、远程命令、传输、隧道。
  • terminal:保持一个可持续读写的交互式会话,并通过 send/read 驱动下一步判断。

配置

环境级配置 (config.json)

terminal skill 的环境级配置目前为空对象 {}。交互终端的关键参数通常和具体会话绑定,优先通过 start 命令显式传入,避免误连设备或误用凭据。

会话状态 (.embeddedskills/state.json)

后台会话运行时状态保存到工作区的 .embeddedskills/state.json,使用 terminal_sessions 字段记录会话名、后端、PID、TCP 控制端口和日志路径。

参数优先级

1. CLI 参数 (--port, --baudrate, --host, --name 等) - 最高优先级 2. 会话状态 (.embeddedskills/state.json 中已启动的 terminal_sessions) 3. 默认值 - 最低优先级

子命令

子命令用途风险
start启动一个后台交互会话
list列出现有会话
status查询单个会话状态
send向会话写入文本或 Hex 数据
read读取并清空会话输出缓冲
attach前台行模式接入会话
stop停止会话并清理状态

后端

后端适用场景依赖
serialMCU UART 控制台、AT 命令、Bootloader 菜单、板卡 CLIpyserial
sshLinux 开发板交互 Shell、登录后持续操作OpenSSH 客户端
local本机临时 Shell、REPL、CLI 程序交互Python 标准库

脚本调用

所有脚本位于 skill 目录的 scripts/ 下,通过 python 直接调用。命令示例均以当前 skill 目录为基准。

# 启动串口终端
python scripts/terminal_session.py start serial --port COM11 --baudrate 115200 --name board

# 启动 SSH 终端,host 使用 ~/.ssh/config 中的 Host 别名
python scripts/terminal_session.py start ssh --host 1380-P904 --name devboard

# 启动本地 Shell
python scripts/terminal_session.py start local --name local-shell

# 发送一行命令并追加 CRLF
python scripts/terminal_session.py send board "help" --crlf

# 读取输出,最多等待 1 秒
python scripts/terminal_session.py read board --timeout 1

# 前台行模式接入
python scripts/terminal_session.py attach board

# 查询与停止
python scripts/terminal_session.py list
python scripts/terminal_session.py status board
python scripts/terminal_session.py stop board

会话状态详情

会话元数据保存到工作区:

.embeddedskills/state.json

使用 terminal_sessions 字段记录:

{
  "terminal_sessions": {
    "board": {
      "backend": "serial",
      "tcp_port": 23145,
      "pid": 1234,
      "started_at": "2026-05-26T10:00:00+08:00"
    }
  }
}

后台进程日志保存到:

.embeddedskills/logs/terminal/

输出格式

脚本默认输出 JSON:

{
  "status": "ok",
  "action": "read",
  "summary": "读取 42 字节",
  "details": {
    "session": "board",
    "text": "help\r\n..."
  }
}

错误输出:

{
  "status": "error",
  "action": "send",
  "error": {
    "code": "session_unreachable",
    "message": "会话不可达,可能已退出"
  }
}

操作流程

1. 判断是否真的需要保持交互状态;若只是一次性远程命令,优先使用 ssh;若只是串口抓日志,优先使用 serial。 2. 选择后端:串口控制台用 serial,远程 shell 用 ssh,本机交互程序用 local。 3. start 后先 read --timeout 1 获取启动横幅、登录提示或 shell prompt。 4. 每次 send 后都用 read --timeout <秒> 观察反馈,再决定下一步。 5. 完成后执行 stop,避免后台进程长期占用串口、SSH 连接或本地 Shell。

核心规则

  • 不自动猜测串口端口、波特率、SSH Host 或登录凭据。
  • 未明确用途时不主动发送任何会改变设备状态的命令。
  • 多个会话必须使用不同 --name,避免输出混淆。
  • read 会清空当前输出缓冲;重要输出需要及时记录到最终回复。
  • attach 是行模式,不等同于完整 TTY/raw 模式;需要全屏程序、vim、top、交互式密码输入时,优先让用户使用真实终端工具。
  • 串口会话会独占真实串口;如果需要和外部串口工具共享端口,先使用 serial skill 的 mux 能力。
  • SSH 后端使用 ~/.ssh/config 的 Host 别名;配置主机、跳板机、传输文件仍交给 ssh skill。
  • 失败时保留真实错误:端口占用、缺少 pyserialssh 不存在、Host 别名无法解析、进程已退出等都不要吞掉。

Related skills

How it compares

Use this for persistent agent-driven terminal sessions—not for replacing your IDE’s built-in one-shot terminal or a dedicated GUI serial monitor.

FAQ

Who is terminal for?

It is for developers—and small embedded teams—who want their AI coding agent to hold interactive serial, SSH, or local shell sessions while debugging hardware and device CLIs.

When should I use terminal?

Use it during Build when integrating UART, SSH, or shell access to boards; during Ship when exercising interactive test menus or consoles; and during Operate when you need repeatable SSH or serial access to deployed devices.

Is terminal safe to install?

It runs local Python helpers, may spawn shells and SSH, and writes session state and logs under `.embeddedskills/`—review the Security Audits panel on this Prism page and pass explicit host/port/credentials on each start rather than relying on shared config.

CLI & Terminalintegrationsdevops

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.