go-pty

1 min read Original article ↗
  __ _  ___        _ __ | |_ _   _
 / _` |/ _ \ _____| '_ \| __| | | |
| (_| | (_) |_____| |_) | |_| |_| |
 \__, |\___/      | .__/ \__|\__, |
 |___/            |_|        |___/

A process manager that runs commands from a Procfile, each in its own pseudoterminal (PTY). Every process gets a real terminal, so you can attach to any running process and use interactive debuggers and REPLs directly.

Press ctrl+] to attach to a process for a full interactive terminal session. Press it again to detach and return to the combined output view.

Demo

Quick start

# Install (macOS)
brew tap lcmen/extra
brew install go-pty

# Install (Linux)
ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
URL=https://github.com/lcmen/go-pty/releases/latest/download
curl -fsSL $URL/go-pty-linux-$ARCH -o ~/.local/bin/go-pty
chmod +x ~/.local/bin/go-pty

# Run
go-pty -f Procfile

# Run subset of processes
go-pty -f Procfile -s web,worker

# Load env vars from .env file
go-pty -f Procfile -e .env

Keyboard shortcuts

Mode Key Action
Normal mode
ctrl+] Open process selection
ctrl+c Shut down and exit
ctrl+r Restart all processes
Dialog mode
Up/Down Navigate list
Enter Attach to process
Esc Cancel
Attached mode
ctrl+] Detach