Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add echoVic/blade-code --skill terminal-uigit clone --depth 1 https://github.com/echoVic/blade-codeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/echovic/blade-code/terminal-ui)<a href="https://agentmods.dev/skills/echovic/blade-code/terminal-ui"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/terminal-ui.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00150 | $0.02189 |
| Opus 5 | $0.00075 | $0.01094 |
| Sonnet 5 | $0.00030 | $0.00438 |
| Haiku 4.5 | $0.00015 | $0.00219 |
Grade A, and why
knowledge-interaction-surfaces-terminal-ui scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 70 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Module Structure
TUI 以单个 vanilla Zustand Store 投影当前 Session,React Hook 只持有活动 Agent/Runtime 和输入交互生命周期;durable 消息、权限模式与恢复数据仍由 Session 服务管理。
Directory Layout
packages/cli/src/ui/App.tsx— 版本提示、Workspace Trust、资源与 Hook 初始化packages/cli/src/ui/components/BladeInterface.tsx— 主界面、阻塞弹窗与 Session 启动路由packages/cli/src/ui/components/MessageArea.tsx— 单 Static 根、流式块和 raw tail 渲染packages/cli/src/ui/components/— 输入、确认、问答、状态和工具展示组件packages/cli/src/ui/hooks/— Agent、命令、输入、确认、Ctrl+C 与缓冲生命周期packages/cli/src/ui/input/terminalInput.ts— bracketed paste 与终端控制序列解析packages/cli/src/ui/utils/— LoopEvent 投影、Session 激活、Markdown 和工具格式化packages/cli/src/store/— React 与非 React 代码共享的当前进程状态packages/cli/src/slash-commands/— TUI 内置与自定义命令路由
Key Entry Points
AppWrapperinpackages/cli/src/ui/App.tsx— 完成信任判断后挂载主界面BladeInterfaceinpackages/cli/src/ui/components/BladeInterface.tsx— 组合输入、弹窗、消息与状态区useCommandHandler()inpackages/cli/src/ui/hooks/useCommandHandler.ts— 单轮命令、取消和恢复编排useAgent()inpackages/cli/src/ui/hooks/useAgent.ts— Agent/SessionRuntime 的唯一 React 所有者createLoopEventHandler()inpackages/cli/src/ui/utils/loopEventHandler.ts— LoopEvent 到 TUI Store 的投影
Gotchas
- 取消顺序不可交换:先
dismissAll()释放阻塞审批,再排空流式缓冲,再 abort,最后 finalize;先 abort 会把审批拒绝误判为普通 permission denial,晚到stream_end还可能重复提交 (packages/cli/src/ui/hooks/useCommandHandler.ts,packages/cli/src/ui/hooks/useConfirmation.ts) createAbortController()会主动中止并替换已有 controller;命令下层必须复用外层 controller,否则 finally 的所有权检查失败并让isProcessing永久卡住 (packages/cli/src/ui/hooks/useCommandHandler.ts,packages/cli/src/store/slices/commandSlice.ts)MessageArea只能有一个 InkStatic根;条件挂载第二个 Static 曾让 Ink 保留已释放 Yoga 节点并在后续 commit 崩溃 (packages/cli/src/ui/components/MessageArea.tsx,docs/testing/tui-single-static-root-ownership-evidence.md,git:c68977b7)- 高频 Markdown tail 绕过 React 直接写 stdout;在 Static 增长、finalize、清屏、resize 或历史展开前必须先清理 raw renderer,否则终端会残留或错位 (
packages/cli/src/ui/components/MessageArea.tsx,packages/cli/src/ui/utils/rawStreamRenderer.ts) clearCount是 Static 的唯一强制重挂边界,finalize 时还必须先eraseScreen + cursorTo(0,0);仅清屏不归位会在顶部留下大段空白 (packages/cli/src/ui/components/MessageArea.tsx)- 一次 stdin 回调可能是完整 IME 文本或批量自动化输入,不能逐字符假设;bracketed paste marker 还可能被 Ink 去掉 ESC 或跨 chunk 到达 (
packages/cli/src/ui/input/terminalInput.ts,docs/reference/tui-terminal-input.md) - 未闭合 paste 会留在 parser buffer,超过消息字符预算后一直丢弃到 end marker;不要把半段 paste 当普通输入提交 (
packages/cli/src/ui/input/terminalInput.ts) - 第一次 Ctrl+C 在执行中只取消任务并显示二次退出提示,3 秒内第二次才走 GracefulShutdown;直接恢复 Ink 的默认
exitOnCtrlC会跳过资源释放 (packages/cli/src/ui/hooks/useCtrlCHandler.ts,packages/cli/src/blade.tsx) - Session 激活必须先完成 fork/load 和 UI-safe 转换,再
cleanupAgent(),最后一次性恢复新 Store;清理失败时不能提前切换界面身份 (packages/cli/src/ui/utils/sessionActivation.ts) - fork 提示是 UI-only assistant message,不进入恢复的 model context;把 visible messages 重建为上下文会污染后续模型输入 (
packages/cli/src/ui/utils/sessionActivation.ts,packages/cli/src/ui/utils/sessionContext.ts) - 阻塞弹窗通过
display="none"隐藏主界面而不卸载,目的是保留 Static 和输入状态;改成条件卸载会重复打印历史并丢失输入组件状态 (packages/cli/src/ui/components/BladeInterface.tsx)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 70 lines · 150 tokens per session scan A 9a1893d7429e
knowledge-interaction-surfaces-terminal-ui is a skill published in the GitHub repository echoVic/blade-code (178 stars, last pushed today), licensed MIT. It adds 150 tokens to every session and 2,189 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
Code Execution
Run Python, Node.js, AND arbitrary shell commands in a secure E2B cloud sandbox that PERSISTS across calls within a conversation. Clone repos, install packages, run CLI tools (git, psql, ffmpeg, duckdb), and build up state turn over turn.
flashcard-generator
Generate educational flashcards from topics, documents, notes, or study materials. Produces structured JSON data and can create polished Tailwind CSS HTML flashcard review pages with interactive card flipping, progress, tags, and difficulty labels.
tg-moderator
Telegram chat moderator/companion mode. No tools, conversational only.
slack-gif-creator
Toolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives. This skill applies when users request animated GIFs or emoji animations for Slack from descriptions like "make me a GIF for Slack of X doing Y".
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.