Repository navigation
v0.1.0
Thor::Interactive 0.1.0
The first stable release of thor-interactive — turn any Thor CLI into an interactive terminal application with persistent state and an optional Claude Code-like TUI.
Highlights
Rich TUI Mode (powered by ratatui_ruby)
Add ratatui_ruby to your Gemfile and set ui_mode: :tui to get:
- Inline viewport — small input area at the bottom, command output flows into normal terminal scrollback
- Multi-line input — Shift+Enter for newlines on modern terminals (Kitty keyboard protocol), Ctrl+N toggle for older terminals
- Status bar — configurable left/center/right sections with app-specific info
- Animated spinner — fun rotating messages ("Thinking...", "Churning...", "Pondering...") with elapsed time during command execution
- Tab completion — popup overlay for commands, options, and paths
- Theming — 4 built-in themes (default, dark, light, minimal) or fully custom colors
- Graceful degradation — falls back to a Reline-based REPL if
ratatui_rubyis not installed
Interactive REPL Core
- State persistence — class variables and instance state survive between commands
- Command dispatch — slash commands (
/help,/exit), option parsing, subcommand support - Default handlers — route unrecognized input to any command (great for natural language interfaces)
- Signal handling — Ctrl+C clears input (double-tap exits), Ctrl+D exits
- Command history — persistent across sessions
Quick Start
# Gemfile
gem 'thor-interactive'
gem 'ratatui_ruby', '~> 1.4'class MyApp < Thor
include Thor::Interactive::Command
configure_interactive(ui_mode: :tui, prompt: "myapp> ")
desc "hello NAME", "Say hello"
def hello(name)
puts "Hello #{name}!"
end
endbundle exec ruby myapp.rb interactiveStats
- 446 specs, 0 failures
- Ruby >= 3.1.0
- MIT License