Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add 02loveslollipop/ctf-toolkit-bootstrap --skill "ssh-async"
Install specific skill from multi-skill repository
# Description
Maintain persistent asynchronous SSH sessions with bidirectional input/output across multiple commands. Use when Codex must keep an SSH shell open, send commands incrementally, inspect prompts or streamed output, reuse one authenticated connection for a task, or safely start/stop a long-lived remote session for debugging, administration, deployment, log inspection, or interactive line-based workflows on remote hosts.
# SKILL.md
name: ssh-async
description: Maintain persistent asynchronous SSH sessions with bidirectional input/output across multiple commands. Use when Codex must keep an SSH shell open, send commands incrementally, inspect prompts or streamed output, reuse one authenticated connection for a task, or safely start/stop a long-lived remote session for debugging, administration, deployment, log inspection, or interactive line-based workflows on remote hosts.
SSH Async
Use scripts/sshx to manage long-lived SSH sessions instead of one-shot ssh invocations.
Workflow
- Start a named session to a remote host.
- Send shell input while the daemon keeps receiving remote output asynchronously.
- Read logs with
--tailfor recent context or--followfor streaming output. - Stop the session explicitly when done.
Commands
# Start an interactive login shell
scripts/sshx start --name demo --host 10.0.0.5 --user ubuntu
# Start with a specific identity file and port
scripts/sshx start --name prod --host prod.example.com --user deploy --port 2222 \
--identity ~/.ssh/deploy_ed25519
# Send a command to the open shell
scripts/sshx send --name prod --data 'uname -a' --newline
# Read recent output
scripts/sshx read --name prod --tail 60
# Follow output live
scripts/sshx read --name prod --follow
# Inspect metadata and process state
scripts/sshx status --name prod
# Stop the session
scripts/sshx stop --name prod
Operational Rules
- Use one session per host/task flow so prompts, working directory, and shell state stay coherent.
- Prefer key-based authentication. The helper runs
sshin batch mode and will fail fast instead of hanging on password prompts. - Append
--newlinefor normal shell commands. - Read with
--tailbefore--followso prompt/output context is visible first. - Stop sessions explicitly to avoid leaving remote shells running.
- If
statusreportsrunning: false, inspectdaemon.logandio.logbefore restarting.
Files and State
Session state lives at /tmp/codex-ssh-async/<name>/:
io.log: timestamped TX/RX events with escaped control charactersrx.raw: raw PTY output bytes from the SSH sessiondaemon.log: daemon stdout/stderr and launcher failuresmeta.json: target metadata and SSH argumentspid: daemon PID
Limitations
- This tool is designed for line-oriented shell workflows, not full-screen TUIs such as
vim,top, orless. - Password, OTP, and passphrase prompts are not supported because the session daemon is intentionally non-interactive during startup.
- If the remote command disables prompts or uses unusual terminal control sequences, inspect
rx.rawin addition toio.log.
References
- For usage patterns and recovery steps, read
references/patterns.md.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.