ratatui_ruby
Introduction
ratatui_ruby is a Ruby wrapper for Ratatui. It allows you to cook up Terminal User Interfaces in Ruby. ratatui_ruby is a community wrapper that is not affiliated with the Ratatui team.
[!WARNING]
ratatui_ruby is currently in an early stage of development. Use at your own risk.
Please join the announce mailing list at lists.sr.ht/~kerrick/ratatui_ruby-announce to stay up-to-date on new releases and announcements.
Compatibility
ratatui_ruby is designed to run on everything Ruby does, including:
-
GNU/Linux, macOS, Windows, OpenBSD, and FreeBSD; and
-
x86_64 (AMD, Intel) and ARM (Apple Silicon, Raspberry Pi).
We support the latest minor version of every non-eol Ruby version, including Ruby 4.
Installation
Add this line to your application’s Gemfile:
gem "ratatui_ruby"
And then execute:
bundle install
Or install it yourself with:
gem install ratatui_ruby
Usage
ratatui_ruby uses an immediate-mode API. You describe your UI using Ruby objects and call draw in a loop.
require "ratatui_ruby" RatatuiRuby.main_loop do |tui| tui.draw \ tui.paragraph \ text: "Hello, Ratatui! Press 'q' to quit.", align: :center, block: tui.block( title: "My Ruby TUI App", borders: [:all], border_color: "cyan" ) event = tui.poll_event break if event && event[:type] == :key && event[:code] == "q" end
For a full tutorial, see the Quickstart.
Documentation
For the full documentation on how to use ratatui_ruby, see the documentation. For other information, see the wiki.
Contributing
Bug reports and pull requests are welcome on sourcehut at sr.ht/~kerrick/ratatui_ruby/. This project is intended to be a safe, productive collaboration, and contributors are expected to adhere to the Code of Conduct.
Issues for the underlying Rust library should be filed at ratatui/ratatui.
Want to help develop ratatui_ruby? Check out the contribution guide on the wiki.
Copyright & License
ratatui_ruby is copyright 2025, Kerrick Long. ratatui_ruby is licensed under the GNU Affero General Public License v3.0 or later; see LICENSES/AGPL-3.0-or-later.txt for the full text.
Some parts of this program are copied from other sources under appropriate reuse licenses, and the copyright belongs to their respective owners. See the REUSE Specification – Version 3.3 for information about how we comply with attribution and licensing requirements.
This program was created with significant assistance from multiple LLMs. The process was human-controlled through creative prompts, with human contributions to each commit. See commit footers for model attribution. declare-ai.org