Skip to content

feat: shell_attach and shell_detach for recording existing terminals#54

Draft
dwmkerr wants to merge 3 commits intomainfrom
feat/shell-attach
Draft

feat: shell_attach and shell_detach for recording existing terminals#54
dwmkerr wants to merge 3 commits intomainfrom
feat/shell-attach

Conversation

@dwmkerr
Copy link
Owner

@dwmkerr dwmkerr commented Jan 15, 2026

Summary

  • Adds shell_attach tool to connect Shellwright to an existing terminal session (requires tmux)
  • Adds shell_detach tool to disconnect from attached sessions
  • Enables recording/screenshots of user's own interactive sessions

Current State (WIP)

  • Basic implementation complete
  • Changed to require explicit tty parameter (more reliable than auto-detection)
  • Documentation added in docs/shell-attach.md
  • Needs testing in real-world usage scenarios

Usage

# Attach to current terminal
shell_attach {"tty": "$(tty)"}

# Take screenshots, record, etc.
shell_screenshot {"session_id": "..."}

# Detach when done
shell_detach {"session_id": "..."}

- Add docs/shell-attach.md explaining how to attach to existing terminals
- Add scripts/mcp-init.sh for initializing MCP sessions
- Add scripts/mcp-tool-call.sh for calling MCP tools from CLI
- Add removal command hint to README
- shell_attach: attach to current terminal via tmux for screenshots/recordings
- shell_detach: clean up attached sessions
- shell_stop now rejects attached sessions (use shell_detach instead)
- shell_send now rejects attached sessions (read-only capture)
- Add tmux helper functions for pane detection and capture
- Add inspect script to package.json
@guardrails
Copy link

guardrails bot commented Jan 15, 2026

⚠️ We detected 3 security issues in this pull request:

Vulnerable Libraries (3)
Severity Details
Low pkg:npm/typescript-eslint@8.50.0 (t) upgrade to: > 8.50.0
Low pkg:npm/@typescript-eslint/parser@8.50.0 (t) upgrade to: > 8.50.0
Low pkg:npm/@typescript-eslint/eslint-plugin@8.50.0 (t) upgrade to: > 8.50.0

More info on how to fix Vulnerable Libraries in JavaScript.


👉 Go to the dashboard for detailed results.

📥 Happy? Share your feedback with us.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

Recording Evaluation

🎬 View recording comparisons

Changed shell_attach to require the tty parameter instead of
auto-detecting the parent TTY. More reliable since the MCP server
may run in a different process context.
@dwmkerr dwmkerr marked this pull request as draft February 13, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant