Communitygithub.com

终端开启器

通过可复用的无Shell启动计划,在可见终端窗口中打开可执行文件及其参数数组,支持空运行、JSON输出、能力检测、分离式回退和独立恢复模式。当Codex需要在新主机终端中打开交互式CLI、SSH会话、本地开发进程、沙箱或其他基于argv的命令时使用;诊断是否支持终端;或在请求的终端不受支持时提供可操作的计划。

终端开启器 是什么?

Terminal Opener(终端开启器)是一个AI助手技能,旨在帮助开发者或AI代理(如Codex)在主机终端中启动交互式CLI、SSH会话、本地开发进程或沙箱命令。它通过JavaScript脚本(`scripts/open-terminal.js`)实现,确保每个可执行文件及其参数作为独立的进程条目处理,绝不插入Shell命令字符串,并将所有spawn调用设置为`shell: false`。该技能默认生成非启动计划,仅在用户明确请求真实窗口且参数(argv)经过审查后才执行`--launch`操作。支持Linux、macOS和Windows平台,主要适配WezTerm终端,并提供多种运行模式:普通模式(尝试WezTerm的mux新窗口,失败后回退到分离的`wezterm start`进程)、恢复模式(通过`--recover`或`--standalone`跳过用户配置)、空运行模式(使用`--dry-run`或省略`--launch`配合`--json`检查计划)、以及能力检测模式(使用`--detect --json`探测终端可用性)。其核心价值在于以结构化、无Shell的方式减少命令注入风险,并通过JSON输出提供清晰的启动计划和故障诊断信息,非常适合需要精确控制终端启动行为的场景。

兼容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/terminal-opener

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

终端开启器 是做什么的?

使用 scripts/open-terminal.js 将可执行文件及其每个参数作为独立的进程条目保存。绝不插入 Shell 命令字符串。将所有 spawn 调用设置为 shell: false。默认生成非启动计划。只有在用户明确请求真实窗口且参数(argv)经过审查后,才使用 --launch。启动的进程继承调用进程的完整环境,包括包含密钥的变量。启动器不会过滤环境。请从环境对目标命令安全的 Shell 中运行它。

启动命令

在 -- 之前传递启动器选项,之后传递一个可执行文件及其参数数组:

node skills/terminal-opener/scripts/open-terminal.js \
  --launch \
  --cwd /absolute/host/path \
  -- ssh -t example.test command-with-arguments

首先运行普通模式。让 WezTerm 尝试其 mux 并在新窗口中打开,如果 mux 不可用,则让启动器回退到分离的 wezterm start 进程。使用回退时,从 JSON 输出(或可读的失败行)中读取 muxFailure 以诊断 mux 路径失败的原因。

从终端配置恢复

当用户配置或 mux 状态可能干扰请求的命令时,添加 --recover 或 --standalone。启动一个分离的 WezTerm 进程,使用:

--skip-config start --always-new-process

预计恢复模式会故意跳过所有用户终端配置。

启动前检查

省略 --launch(或添加 --dry-run)并添加 --json 来检查确切的执行文件、参数(argv)、工作目录、终端适配器、主启动和回退,而不打开窗口。将 JSON 计划视为调用者的组合边界。

运行 --detect --json 而不带命令,以探测终端可用性。当适配器缺失或不受支持时,遵循返回的 action。对当前适配器使用 WezTerm;将其他请求的终端视为不受支持的计划,而不是要执行的命令。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相关技能