← ClaudeAtlas

run-in-terminallisted

Run any command in any directory in a new herdr tab, or a native terminal tab (Windows Terminal from WSL2, Terminal.app, Linux). Defaults to $HOME with an interactive shell, but accepts an arbitrary command (claude, npm run dev, a chained `a && b`, anything) and an optional target directory. On a native-terminal failure it checks WSL interop and prints the exact command the operator must run. Use when the user says "run in terminal", "run-in-terminal", "run terminal", "run <cmd> in <dir>", "run this in <dir>", "run command in directory", "open claude at <path>", "open a shell at <path>", or "launch terminal at <path>".
the-cloud-clockwork/agentihooks · ★ 1 · AI & Automation · score 70
Install: claude install-skill the-cloud-clockwork/agentihooks
# Run In Terminal — Run Any Command in Any Directory Run it when the operator asks for it; no typed phrase and no guard gate it. Opens a new terminal tab/window targeting any directory and runs an arbitrary command there. On WSL2, opens a Windows Terminal tab via the `wt.exe → powershell.exe → wsl.exe → bash` chain (same pattern as agentihooks session_registry.py) to avoid wt.exe semicolon parsing bugs. On macOS, opens a Terminal.app window via `osascript`. The command is passed **raw** into `bash -lc`, so anything you can type at a shell works: a single binary (`claude`), a chained command (`git pull && make`), pipes, quotes, env assignments. With no command, the tab drops into an interactive shell. With no directory, it lands in `$HOME`. ## Script Resolution ```bash SKILL_DIR="$(dirname "$(readlink -f ~/.claude/skills/run-in-terminal/SKILL.md)" 2>/dev/null || echo "$HOME/.claude/skills/run-in-terminal")" ``` --- ## Step 1: Parse Arguments The **command** is the primary input; the directory is optional. - **command** — the thing to run after `cd`'ing into the directory. Raw shell string. Default: none → drop into an interactive `bash`. - **directory** (`--dir`, or "in <path>" / "at <path>") — where to run. Default: `$HOME`. - **title** (`--title`) — tab title. Default: basename of the directory. Natural-language → invocation mapping: | Operator says | directory | command | |---|---|---| | "run terminal" / "open a shell" | `$HOME` | (interactive bash) | | "run