pty-wrap
v1.0.4
Published
PTY wrapper for capturing terminal sessions via MQTT
Maintainers
Readme
pty-wrap
PTY wrapper for capturing terminal sessions via MQTT.
Installation
npm install -g pty-wrapUsage
# Capture any command
pty-wrap <command> [args...]
# Examples
pty-wrap claude
pty-wrap bash
pty-wrap vim file.txtEnvironment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| MQTT_URL | mqtt://localhost:1883 | MQTT broker URL |
| MQTT_USERNAME | (empty) | MQTT authentication username |
| MQTT_PASSWORD | (empty) | MQTT authentication password |
| SESSION_ID | Auto-generated UUID | Custom session identifier |
How It Works
- Spawns the target command in a PTY (pseudo-terminal)
- Captures all input/output streams
- Publishes to MQTT topic
sessions/{SESSION_ID}/stream - Transparently proxies terminal I/O
Requirements
- Node.js >= 18.0.0
- MQTT broker (e.g., EMQX, Mosquitto)
License
MIT
