diff --git a/tty-fwd/README.md b/tty-fwd/README.md index f0f59b2b..73569de0 100644 --- a/tty-fwd/README.md +++ b/tty-fwd/README.md @@ -1,17 +1,73 @@ -# tty-spawn +# tty-fwd -[![Crates.io](https://img.shields.io/crates/d/tty-spawn.svg)](https://crates.io/crates/tty-spawn) -[![License](https://img.shields.io/github/license/mitsuhiko/teetty)](https://github.com/mitsuhiko/teetty/blob/main/LICENSE) -[![rustc 1.63.0](https://img.shields.io/badge/rust-1.63%2B-orange.svg)](https://img.shields.io/badge/rust-1.63%2B-orange.svg) -[![Documentation](https://docs.rs/tty-spawn/badge.svg)](https://docs.rs/tty-spawn) +`tty-fwd` is a utility to capture TTY sessions and forward them. It spawns processes in a pseudo-TTY and records their output in asciinema format while providing remote control capabilities. -`tty-spawn` is the underlying library on which -[`teetty`](https://github.com/mitsuhiko/teetty) is built. It lets you spawn -processes in a fake TTY and duplex stdin/stdout so you can communicate with an -otherwise user attended process. +## Features -## License and Links +- **Session Management**: Create, list, and manage TTY sessions +- **Remote Control**: Send text and key inputs to running sessions +- **Output Recording**: Records sessions in asciinema format for playback +- **Session Persistence**: Sessions persist in control directories with metadata +- **Process Monitoring**: Tracks process status and exit codes -* [Documentation](https://docs.rs/tty-spawn/) -* [Issue Tracker](https://github.com/mitsuhiko/teetty/issues) -* License: [Apache-2.0](https://github.com/mitsuhiko/teetty/blob/main/LICENSE) +## Usage + +### Basic Usage + +Spawn a command in a TTY session: +```bash +tty-fwd -- bash +``` + +### Session Management + +List all sessions: +```bash +tty-fwd --list-sessions +``` + +Create a named session: +```bash +tty-fwd --session-name "my-session" -- vim +``` + +### Remote Control + +Send text to a session: +```bash +tty-fwd --session --send-text "hello world" +``` + +Send special keys: +```bash +tty-fwd --session --send-key enter +tty-fwd --session --send-key arrow_up +``` + +Supported keys: `arrow_up`, `arrow_down`, `arrow_left`, `arrow_right`, `escape`, `enter` + +### Cleanup + +Remove stopped sessions: +```bash +tty-fwd --cleanup +``` + +Remove a specific session: +```bash +tty-fwd --session --cleanup +``` + +## Options + +- `--control-path`: Specify control directory location (default: `~/.vibetunnel/control`) +- `--session-name`: Name the session when creating +- `--session`: Target specific session by ID +- `--list-sessions`: List all sessions with metadata +- `--send-text`: Send text input to session +- `--send-key`: Send special key input to session +- `--cleanup`: Remove exited sessions + +## License + +Licensed under the Apache License, Version 2.0. \ No newline at end of file