跳到正文
Skillpedia
通用编程280k · #422

terminal-opener

它能做什么

这个程序可以在一个单独的窗口中打开你电脑上的某个程序或命令。它的运行方式很安全,不会把多条命令混在一起,并且能让你看到正在发生的事情。

适用场景

  • ✓当你需要运行一个交互式程序时。
  • ✓当你需要启动一个安全连接(SSH)时。
  • ✓当你想测试或调试命令,但又不想真正执行它们时。

技能链接

https://github.com/affaan-m/ECC/blob/main/skills/terminal-opener/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/affaan-m/ECC/blob/main/skills/terminal-opener/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“在新窗口中打开程序 'my_app',并传入参数 '--config' 和 'config.json'。”

每周 5 个新技能,1 分钟读完。

工作原理

它会把程序名称和所有参数分开处理,然后打开一个新窗口来运行这个程序,确保整个过程是隔离的、安全的。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Terminal Opener

Use scripts/open-terminal.js to preserve an executable and every argument as separate process entries. Never interpolate a shell command string. Keep every spawn on shell: false. Default to a non-launching plan. Use --launch only after the user explicitly requests a real window and the argv has been reviewed. The launched process inherits the full environment of the calling process, including secret-bearing variables. The launcher does not filter the environment. Run it from a shell whose environment is safe to expose to the target command.

Launch a command

Pass launcher options before --, then pass exactly one executable followed by its argument array:

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

Run normal mode first. Let WezTerm try its mux with a new window, then let the launcher fall back to a detached wezterm start process if the mux is not available. When fallback is used, read muxFailure from JSON output (or the human-readable failure line) to diagnose why the mux path failed.

Recover from terminal configuration

Add --recover or --standalone when user configuration or mux state may interfere with the requested command. Start a detached WezTerm process with:

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

Expect recovery mode to skip all user terminal configuration intentionally.

Inspect before launch

Omit --launch (or add --dry-run) and add --json to inspect the exact executable, argv, working directory, terminal adapter, primary launch, and fallback without opening a window. Treat the JSON plan as the composition boundary for callers.

Run --detect --json without a command to probe terminal availability. Follow the returned action when the adapter is missing or unsupported. Use WezTerm for the current adapter; treat other requested terminals as unsupported plans, not as commands to execute.

常见问题

“不混合命令”是什么意思?

这是指它不会把多条命令合并成一段文本,从而避免出错,也提高了安全性。

什么是“dry-run 模式”?

这是一种只展示程序将如何被打开、但并不真正打开它的模式。在正式运行之前,用它检查一切是否正确很有用。

打开之前能先看到相关信息吗?

可以。使用 `--json` 选项,你就能看到程序将如何被打开的所有细节,而不会真正执行。

详情

作者的原始描述

Open an executable and its argument array in a visible terminal window through a reusable, shell-free launch plan with dry-run, JSON, capability detection, detached fallback, and standalone recovery modes. Use when Codex needs to open an interactive CLI, SSH session, local development process, sandbox, or other argv-based command in a new host terminal; diagnose whether a supported terminal is ava

repo: affaan-m/ECC

热度

GitHub 星标
280k
排名
#422
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能