terminal
Skill764 starsChanged 2 months agoMITView on GitHub
双向交互终端会话工具,用于串口终端、SSH 交互 Shell、本地 Shell、设备控制台、AT/CLI 菜单、需要保持上下文的交互式调试;当用户提到交互终端、串口终端、SSH 终端、打开 shell、发送命令后继续读输出、保持会话、登录后操作、菜单式命令行时触发,也兼容 /terminal 显式调用。
- Reads credentials
4 other projects use a version of this.
Adopted by
Most recently taken up by
- wonderwhy-er/DesktopCommanderMCPtheir own version, first seen Oct 8, 2026
- samirpatil2000/skillstheir own version, first seen Sep 26, 2026
- DojoCodingLabs/code-senseitheir own version, first seen Mar 20, 2026
- wewpellex21/code-senseitheir own version, first seen Feb 7, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- wonderwhy-er/DesktopCommanderMCP★ 10ksame name
- samirpatil2000/skills★ 17same name
- DojoCodingLabs/code-sensei★ 14same name
- wewpellex21/code-sensei★ 3same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Files
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 控制端口和日志路径。
参数优先级
- CLI 参数 (
--port,--baudrate,--host,--name等) - 最高优先级 - 会话状态 (
.embeddedskills/state.json中已启动的terminal_sessions) - 默认值 - 最低优先级
子命令
| 子命令 | 用途 | 风险 |
start | 启动一个后台交互会话 | 中 |
list | 列出现有会话 | 低 |
status | 查询单个会话状态 | 低 |
send | 向会话写入文本或 Hex 数据 | 中 |
read | 读取并清空会话输出缓冲 | 低 |
attach | 前台行模式接入会话 | 中 |
stop | 停止会话并清理状态 | 中 |
后端
| 后端 | 适用场景 | 依赖 |
serial | MCU UART 控制台、AT 命令、Bootloader 菜单、板卡 CLI | pyserial |
ssh | Linux 开发板交互 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": "会话不可达,可能已退出"
}
}操作流程
- 判断是否真的需要保持交互状态;若只是一次性远程命令,优先使用
ssh;若只是串口抓日志,优先使用serial。 - 选择后端:串口控制台用
serial,远程 shell 用ssh,本机交互程序用local。 start后先read --timeout 1获取启动横幅、登录提示或 shell prompt。- 每次
send后都用read --timeout <秒>观察反馈,再决定下一步。 - 完成后执行
stop,避免后台进程长期占用串口、SSH 连接或本地 Shell。
核心规则
- 不自动猜测串口端口、波特率、SSH Host 或登录凭据。
- 未明确用途时不主动发送任何会改变设备状态的命令。
- 多个会话必须使用不同
--name,避免输出混淆。 read会清空当前输出缓冲;重要输出需要及时记录到最终回复。attach是行模式,不等同于完整 TTY/raw 模式;需要全屏程序、vim、top、交互式密码输入时,优先让用户使用真实终端工具。- 串口会话会独占真实串口;如果需要和外部串口工具共享端口,先使用
serialskill 的 mux 能力。 - SSH 后端使用
~/.ssh/config的 Host 别名;配置主机、跳板机、传输文件仍交给sshskill。 - 失败时保留真实错误:端口占用、缺少
pyserial、ssh不存在、Host 别名无法解析、进程已退出等都不要吞掉。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

