Catalog
affaan-m/terminal-opener

affaan-m

terminal-opener

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 available; or provide an actionable plan when the requested terminal is unsupported.

v1.0Latest
New~624Updated Aug 6, 2026

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.

Files3
3 files · 12.9 KB

Select a file to preview

Overall Score

80/100

Grade

B

Good

Safety

82

Quality

78

Clarity

75

Completeness

79

Summary

Terminal Opener provides a structured, argv-safe launcher for executing commands in WezTerm terminal windows. It preserves arguments as separate process entries without shell interpolation, supports dry-run inspection, capability detection, and recovery modes. The skill is designed to prevent command injection by rejecting shell command strings and enforcing explicit option parsing.

Static Analysis Findings

1 finding

Patterns detected by deterministic static analysis before AI scoring. Hover over any finding code for detailed information and remediation guidance.

Credential Exposure
SEC-020Direct .env File Access2x in 1 file

Direct .env file access

scripts/open-terminal.js.env2x

Detected Capabilities

process spawning (child_process.spawn, spawnSync)environment variable reading (ECC_TERMINAL, process.env)file system path validation and resolutionJSON output generationerror handling and exit codes

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

open terminal windowlaunch ssh sessionexecute in terminaldry-run command plandetect terminal availabilitywezterm spawn

Risk Signals

WARNING

Direct access to process.env (full environment exposure)

scripts/open-terminal.js:parseArgs(), line 92; launch() function
INFO

SEC-020: Environment variable reads (ECC_TERMINAL, process.env)

scripts/open-terminal.js:92
INFO

.env file reference in static analysis detector

scripts/open-terminal.js (static flag)

Use Cases

  • Open interactive CLI sessions in new terminal windows
  • Launch SSH connections with arguments preserved safely
  • Start local development processes in visible terminals
  • Diagnose whether WezTerm or other terminal adapters are available
  • Provide actionable launch plans without immediately opening windows
  • Recover from terminal misconfiguration using standalone mode

Quality Notes

  • Strengths: Excellent input validation (validateExecutable, validateArgv) prevents shell injection; argv preserved as separate entries; explicit dry-run mode; JSON inspection before launch; clear separation of concerns (plan building, capability detection, launch); comprehensive error handling with descriptive messages
  • Strengths: Usage documentation in code; modular exports for testing; no hardcoded credentials; supports multiple launch strategies (mux, detached, recover)
  • Weaknesses: SKILL.md is sparse—lacks explicit guardrails section, error recovery guidance, or examples of unsafe inputs; no documentation of what environments are safe to expose to target commands
  • Weaknesses: Environment inheritance is mentioned in SKILL.md but not detailed in the script—no filtering mechanism documented; recover mode described verbally but not tied to code
  • Weaknesses: Capability detection is WezTerm-only; adding other terminals requires code change, not configuration
  • Weaknesses: Missing edge case documentation (e.g., what happens if --cwd does not exist, or if spawned process fails)
Model: claude-haiku-4-5-20251001Analyzed: Aug 6, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use affaan-m/terminal-opener in your dev environment

Command Palette

Search for a command to run...