Skip to content

Gaurav-Gosain/tuios

Repository files navigation

TUIOS - Terminal UI Operating System

Latest Release GoDoc Ask DeepWiki
Terminal Trove Tool of The Week

TUIOS

TUIOS is a terminal-based window manager that provides a modern, efficient interface for managing multiple terminal sessions. Built with Go using the Charm stack (Bubble Tea v2 and Lipgloss v2), TUIOS offers a vim-like modal interface with comprehensive keyboard shortcuts, workspace support, and mouse interaction.

Documentation

Table of Contents

Installation

Package Managers

Homebrew (macOS/Linux):

# TUIOS terminal window manager
brew install tuios

# tuios-web (separate binary for web terminal server)
brew install tuios-web

Arch Linux (AUR):

# TUIOS terminal window manager
yay -S tuios-bin

# tuios-web (separate binary for web terminal server)
yay -S tuios-web-bin

Nix:

# Run directly
nix run github:Gaurav-Gosain/tuios#tuios

# Or add to your configuration
nix-shell -p tuios

Quick Install Script

Linux/macOS:

curl -fsSL https://raw.githubusercontent.com/Gaurav-Gosain/tuios/main/install.sh | bash

Alternative Methods:

  • GitHub Releases - Download pre-built binaries for both tuios and tuios-web
  • Go Install:
    • go install github.com/Gaurav-Gosain/tuios/cmd/tuios@latest (main binary)
    • go install github.com/Gaurav-Gosain/tuios/cmd/tuios-web@latest (web server)
  • Docker: docker run -it --rm ghcr.io/gaurav-gosain/tuios:latest
  • Build from Source: See Development section below

Requirements:

  • A terminal with true color support (most modern terminals)
  • Go 1.24+ (if building from source)

Features

TUIOS

  • Multiple Terminal Windows: Create and manage multiple terminal sessions
  • 9 Workspaces: Organize windows across independent workspaces
  • Modal Interface: Vim-inspired Window Management and Terminal modes
  • Automatic Tiling: Optional grid-based window layouts
  • Vim-Style Copy Mode: Navigate scrollback (10,000 lines), search, and select text with vim keybindings
  • Customizable Keybindings: TOML configuration file with full keybinding customization (Kitty protocol support)
  • Mouse Support: Click, drag, and resize with full mouse interaction
  • SSH Server Mode: Remote terminal multiplexing with per-connection isolation
  • Web Terminal Mode: Access TUIOS from any browser with WebGL rendering
  • Smart Performance: Style caching, viewport culling, adaptive refresh (60Hz/30Hz)

Quick Start

Launch TUIOS:

tuios

Essential Keys:

Window Management Mode (default):

  • n - Create new window
  • i or Enter - Enter Terminal Mode

Works from any mode:

  • Ctrl + B c - Create new window
  • Ctrl + B ? - Toggle help overlay
  • Ctrl + B [ - Enter copy mode (vim-style scrollback)
  • Ctrl + B d or Esc - Return to Window Management Mode
  • Ctrl + B q - Quit

Alternative (Ctrl + B t submenu):

  • Ctrl + B t n - Create new window
  • Ctrl + B t x - Close window
  • Ctrl + B t r - Rename window

SSH Server Mode:

tuios ssh                            # Start on localhost:2222
tuios ssh --host 0.0.0.0 --port 8022 # Custom host/port
ssh -p 2222 localhost                # Connect

Web Terminal Mode (requires separate tuios-web binary):

tuios-web                            # Start on http://localhost:7681
tuios-web --port 8080                # Custom port
tuios-web --theme dracula            # With theme
open http://localhost:7681           # Open in browser

Features: WebGL rendering, WebTransport/WebSocket, bundled Nerd Fonts, settings panel.

Install tuios-web:

# Homebrew
brew install tuios-web

# AUR
yay -S tuios-web-bin

# Go install
go install github.com/Gaurav-Gosain/tuios/cmd/tuios-web@latest

Tape Scripting (Automation):

# Run tape script in headless mode (background)
tuios tape run examples/demo.tape

# Run tape script with visible TUI (watch automation)
tuios tape play examples/demo.tape

# Validate tape file syntax
tuios tape validate examples/demo.tape

Configuration:

tuios config edit                    # Edit keybindings in $EDITOR
tuios config path                    # Print config file location
tuios config reset                   # Reset to defaults
tuios keybinds list                  # View all current keybindings
tuios keybinds list-custom           # View only your customizations

Shell Completions:

# Bash
tuios completion bash > /etc/bash_completion.d/tuios

# Zsh
tuios completion zsh > "${fpath[1]}/_tuios"

# Fish
tuios completion fish > ~/.config/fish/completions/tuios.fish

# PowerShell
tuios completion powershell > tuios.ps1

For complete keybindings, configuration options, and CLI flags, see the Documentation section above.

Tape Scripting

TUIOS supports automation through .tape files - a simple, declarative format for automating interactions. Perfect for:

  • Recording and replaying terminal workflows
  • Automated testing
  • Demo recording
  • CI/CD automation
  • Terminal workflow documentation
  • Setup of development environments

Basic Tape File Syntax:

# Create windows and windows
NewWindow
Sleep 500ms

# Type text with delays
Type "echo 'Hello, TUIOS!'"
Enter

# Key presses and combinations
Ctrl+B
Type "n"

# Navigation and window management
SwitchWorkspace 2
Sleep 1s

# Sleep between commands
Sleep 500ms

Supported Commands:

  • Type "text" - Type text
  • Type@100ms "text" - Type with custom speed
  • Enter, Space, Tab, Escape - Special keys
  • Backspace, Delete - Editing keys
  • Up, Down, Left, Right - Navigation
  • Ctrl+X, Alt+X, Shift+X - Key combinations
  • Sleep 500ms or Sleep 2s - Delays
  • NewWindow, CloseWindow, ToggleTiling - Window management
  • SwitchWorkspace N - Switch to workspace
  • MoveToWorkspace N - Move window to workspace
  • Focus, Split - Window manipulation

Running Tape Scripts:

# Headless mode (background) - useful for automation
tuios tape run script.tape

# Interactive mode (visible TUI) - watch it happen
tuios tape play script.tape

# Validate syntax
tuios tape validate script.tape

Example Tapes:

  • examples/simple.tape - Basic tape file
  • examples/demo.tape - Comprehensive demo
  • examples/advanced.tape - Complex scenarios

Architecture

TUIOS is built on the Bubble Tea v2 framework following the Model-View-Update pattern. For detailed architecture diagrams and technical documentation, see Architecture Guide.

Key Technologies:

Core Components:

Performance

Optimization Strategies:

  • Smart caching with sequence-based change detection
  • Viewport culling for off-screen windows
  • Adaptive refresh rates (60Hz focused, 30Hz background)
  • Memory pooling for strings, buffers, and styles
  • LRU style cache (40-60% allocation reduction)
  • Frame skipping when no changes detected

Troubleshooting

Common Issues:

  • Colors not displaying: Set COLORTERM=truecolor environment variable
  • SSH connection issues: Use --host 0.0.0.0 for remote access, check firewall settings
  • Performance with many windows: Enable tiling mode (t key)

Debug Mode: Press Ctrl + L to view system logs.

Roadmap

Completed:

  • ✓ Multiple windows with 9 workspaces
  • ✓ Automatic tiling and snapping
  • ✓ Vim-style copy mode with search
  • ✓ SSH server mode
  • ✓ Performance optimizations
  • ✓ TOML configuration system with custom keybindings

Planned:

  • Theme and color customization
  • Session persistence
  • Split panes and tabs
  • Plugin system

Development

Contributions are welcome! Feel free to open issues or pull requests.

Build from Source:

git clone https://github.com/gaurav-gosain/tuios.git
cd tuios
go build -o tuios ./cmd/tuios
./tuios

Run Tests:

go test ./...

Support: ko-fi

Star History

Star History Chart

GitHub Language Count GitHub Top Language Repo Size GitHub Issues GitHub Closed Issues GitHub Pull Requests GitHub Closed Pull Requests GitHub Contributors GitHub Last Commit GitHub Commit Activity (Week)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • The Charm team for Bubble Tea and Lipgloss libraries
  • The Go terminal ecosystem for PTY and VT implementations
  • The vim and tmux communities for interface design inspiration

About

Terminal UI OS (Terminal Multiplexer)

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Languages