ghostty
Control the Ghostty terminal on macOS through AppleScript: panes, tabs, and windows. Use when splitting the terminal, opening a tab or window, running a long…
от Integralist★ 31 звезда на GitHub
Установить ghostty в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Ghostty Terminal Automation
Drive Ghostty's splits, tabs, windows, and processes on macOS with
osascript, so heavy or interactive work runs in its own pane and only its
result comes back to the agent.
When to use a pane. Use one for long suites (make test-integration,
e2e, Docker builds), dev servers and watchers, interactive TUIs, and visible
subagents. Run anything that finishes in under 3 seconds with under 50 lines
of output (a single unit test, git, a file check) directly with the shell
tool. Ghostty's AppleScript works only on macOS with Ghostty as the local
terminal, so use the shell tool on Linux, in CI, or over SSH. The API can't
read a pane's scrollback, so redirect any output you need to a log file. When
a pane runs a subagent, follow
SUBAGENT-STEERABILITY.md, including its
completion and retry protocol, and confirm completion from its recorded
output before reporting success.
Preflight. Control needs macOS Automation (TCC) permission, and tty
and pid need Ghostty 1.4.0 or later. Probe both once:
osascript -e '
with timeout of 5 seconds
tell application "Ghostty" to get version
end timeout' >/dev/null 2>&1 || {
echo "Ghostty unreachable: ensure Ghostty is running, macos-applescript is not false, and Automation permissions are granted."
exit 1
}
TERM_COUNT=$(osascript -e 'tell application "Ghostty" to return count of terminals' 2>/dev/null)
if [ "${TERM_COUNT:-0}" -gt 0 ]; then
osascript -e 'tell application "Ghostty" to get tty of first terminal' >/dev/null 2>&1 || {
echo "Requires Ghostty 1.4.0+ (tty and pid properties absent on terminal class)."
exit 1
}
fi
State. Each tool call runs in a fresh subshell, so persist handles in a
per-user directory. last-pane holds the most recently created or targeted
pane, and each new split or job overwrites it; last-job holds the running
job's log, pane, and runner script.
STATE_DIR="/tmp/ghostty-skill-$(id -u)"
mkdir -p "$STATE_DIR"
Caller TTY. Ghostty lists every terminal, including Quick Terminal
overlays, under every terminal. Find the caller's TTY from this shell or its
parent, so a new pane opens beside the caller; with no TTY, the scripts fall
back to the front window. Put this, with the state lines above, at the top of
each create or launch command below:
tty_dev=$(ps -o tty= -p $$ 2>/dev/null | grep -v '?' | tr -d ' ')
[ -n "$tty_dev" ] || tty_dev=$(ps -o tty= -p $PPID 2>/dev/null | grep -v '?' | tr -d ' ')
case "$tty_dev" in '') TTY_DEV="" ;; *) TTY_DEV="/dev/$tty_dev" ;; esac
Pass values to AppleScript as positional arguments (argv), never by
interpolating them into the script, to avoid escaping bugs.
Surface configuration
| Property | Type | Description |
|---|---|---|
initial working directory |
text | Working directory for the process. |
font size |
real | Font size in points. |
command |
text | Executable script or binary path (skips .zshrc). |
wait after command |
bool | Keep pane open after command exits. |
initial input |
text | Text sent to the interactive shell after launch. |
environment variables |
list | List of "KEY=VALUE" strings. |
Use command to run a binary or runner script without a login shell, which
skips ~/.zshrc and the 1Password, Touch ID, or rc prompts it can trigger;
add wait after command to keep the pane open for review. Use
initial input to start your login shell with its aliases and type into it.
Create a split, tab, or window
Split. Directions are right, down, left, and up.
TARGET_DIR="$PWD"
INIT_INPUT="echo 'hello from split'"
TARGET_ID=$(osascript - "$TTY_DEV" "$TARGET_DIR" "$INIT_INPUT" <<'APPLESCRIPT'
on run argv
set targetTty to item 1 of argv
set targetDir to item 2 of argv
set initInput to item 3 of argv
tell application "Ghostty"
if targetTty is not "" and (count of (terminals whose tty is targetTty)) > 0 then
set myTerm to (first terminal whose tty is targetTty)
else
set myTerm to focused terminal of selected tab of front window
end if
set cfg to new surface configuration
set initial working directory of cfg to targetDir
if initInput is not "" then
set initial input of cfg to initInput & linefeed
end if
set newTerm to split myTerm direction right with configuration cfg
return id of newTerm
end tell
end run
APPLESCRIPT
)
[ -n "$TARGET_ID" ] || { echo "Failed to create split surface; check preflight."; exit 1; }
printf '%s\n' "$TARGET_ID" > "$STATE_DIR/last-pane"
Tab. The Quick Terminal has no tabs, and new tab there opens a blocking
modal dia
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл ghostty?
Control the Ghostty terminal on macOS through AppleScript: panes, tabs, and windows. Use when splitting the terminal, opening a tab or window, running a long command or test suite out of band in another pane, spawning a visible subagent or interactive tool, sending text or keystrokes to a pane, or listing open Ghostty terminals.
Как установить скилл ghostty?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ghostty запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…