Terminal logo

Terminal

Community
zhinkgit
terminal

双向交互终端会话工具,用于串口终端、SSH 交互 Shell、本地 Shell、设备控制台、AT/CLI 菜单、需要保持上下文的交互式调试;当用户提到交互终端、串口终端、SSH 终端、打开 shell、发送命令后继续读输出、保持会话、登录后操作、菜单式命令行时触发,也兼容 /terminal 显式调用。

Overview

Publisherzhinkgit
Repositoryembeddedskills
Skill nameterminal
Stars
739
Forks
94
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by zhinkgit on GitHub. Read the source before you install it.

Installation

Install the Terminal AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/zhinkgit/embeddedskills/tree/main/terminal
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zhinkgit/embeddedskills.git /tmp/embeddedskills
mkdir -p .claude/skills
cp -r /tmp/embeddedskills/terminal .claude/skills/terminal
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Terminal in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Terminal on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Terminal is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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 目录为基准。

bash
# 启动串口终端
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

会话状态详情

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

text
.embeddedskills/state.json

使用 terminal_sessions 字段记录:

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

后台进程日志保存到:

text
.embeddedskills/logs/terminal/

输出格式

脚本默认输出 JSON:

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

错误输出:

json
{
  "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。
  • 失败时保留真实错误:端口占用、缺少 pyserial、ssh 不存在、Host 别名无法解析、进程已退出等都不要吞掉。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Terminal AI skill do?

双向交互终端会话工具,用于串口终端、SSH 交互 Shell、本地 Shell、设备控制台、AT/CLI 菜单、需要保持上下文的交互式调试;当用户提到交互终端、串口终端、SSH 终端、打开 shell、发送命令后继续读输出、保持会话、登录后操作、菜单式命令行时触发,也兼容 /terminal 显式调用。

Why use Terminal on TypingMind?

Because you install it once and use it with any model. Terminal is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Terminal in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zhinkgit/embeddedskills/tree/main/terminal. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Terminal?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Terminal?

As many as you like. As long as a model supports skills, you can use Terminal with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Terminal AI skill free?

Yes. It is published on GitHub by zhinkgit under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇