Communitygithub.com

終端機開啟器

透過可重複使用、無 shell 的啟動計劃(含乾執行、JSON、能力偵測、分離後備與獨立復原模式)在可見終端機視窗中開啟可執行檔及其引數陣列。當 Codex 需要在新主機終端機中開啟互動式 CLI、SSH 連線、本地開發程序、沙盒或其他基於 argv 的命令時使用;診斷是否支援某終端機;或在請求的終端機不受支援時提供可行計劃。

終端機開啟器 是什麼?

此技能提供一個指令碼 (`open-terminal.js`),用於在新的終端機視窗中啟動可執行檔,並保留其引數陣列,完全避免使用 shell 字串插值。這對需要開啟互動式工作階段(如 SSH 連線、開發伺服器或沙盒)的 AI 編碼代理(如 Codex)至關重要,因為它能保持嚴格的控制且不新增 shell 注入風險。支援 WezTerm 作為主要終端機介面卡,並提供多種操作模式:預設的乾執行計劃 (`--dry-run` 或省略 `--launch`)、實際視窗啟動 (`--launch`)、JSON 輸出 (`--json`) 用於程式化檢查、終端機能力偵測 (`--detect --json`),以及用於繞過使用者組態或復原問題的分離後備與復原模式 (`--recover`、`--standalone`)。重點在於永遠不在 shell: false 環境中內插 shell 字串,讓代理能安全地啟動終端機程序,同時維持環境變數(包括敏感資料)的傳遞。

相容平台~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.

相關技能