How polds/tui-streamer works
tui-streamer runs commands in named sessions and streams their output to a browser terminal. Users create or import sessions, submit commands, and receive live output over WebSockets; sessions also support control operations and multiple subscribers. YAML Bundles and BundleSets add preconfigured sessions, autorun commands, themes, allowlists, and files. The map includes the command runner and in-memory session state as internal layers. Some capabilities are documented but their implementation was not sampled, so uncertain internal wiring is omitted.
Main entry points: server.go HTTP / WS API · main.go Server Entry · session.go Session State · import.go Bundle Import
Components 18
Server Runtime
- Server Entry
cmd/server/main.go - HTTP / WS API
internal/server/server.go - Session Manager
internal/session/manager.go - Session State
internal/session/session.go - WS Client
internal/session/client.go - Browser Launcher
internal/browser/open.go
Command Execution
- Command Runner
internal/executor/executor.go - Command Allowlist
internal/bundle/allow.go
Bundle Configuration
- Bundle Loader
internal/bundle/bundle.go - Bundle Import
internal/server/import.go - Bundle Files
internal/bundle/files.go
Web Terminal
- Embedded UI
web/embed.go - Terminal UI
web/static/app.js - ANSI Rendering
web/static/app.js - Themes
internal/bundle/themes.go
Other components
- User
- Browser
- OS Processes
Connections 31
- User → Browser: uses
- User → Server Entry: starts server
- Server Entry → Bundle Loader: loads YAML
- Server Entry → Session Manager: creates
- Server Entry → Bundle Import: imports startup bundle
- Server Entry → HTTP / WS API: starts listener
- Server Entry → Embedded UI: provides static files
- Server Entry → Browser Launcher: opens UI
- Browser Launcher → Browser: launches
- Browser → HTTP / WS API: HTTP requests
- HTTP / WS API → Embedded UI: serves UI
- HTTP / WS API → Session Manager: manages sessions
- HTTP / WS API → Session State: executes / controls
- HTTP / WS API → Bundle Loader: parses imports
- HTTP / WS API → Command Allowlist: checks commands
- Bundle Import → Session Manager: creates sessions
- Bundle Import → Session State: sets session details
- Bundle Import → Command Allowlist: merges allowlists
- Bundle Loader → Bundle Files: resolves files
- Session State → Command Runner: runs command
- Command Runner → OS Processes: starts process
- OS Processes → Command Runner: writes output
- Command Runner → Session State: streams lines
- Session State → WS Client: broadcasts lines
- HTTP / WS API → WS Client: upgrades connection
- Browser → HTTP / WS API: opens WebSocket
- WS Client → Browser: sends output
- Browser → Terminal UI: interacts
- Terminal UI → HTTP / WS API: calls API
- Terminal UI → ANSI Rendering: formats output
- Terminal UI → Themes: selects theme