ratatui_ruby

[!NOTE]
ratatui_ruby is a community wrapper that is not affiliated with the Ratatui team.

Introduction

ratatui_ruby is a Ruby wrapper for Ratatui. It allows you to cook up Terminal User Interfaces in Ruby.

[!WARNING]
ratatui_ruby is currently in an early stage of development. Use at your own risk.

Please join our 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:

Installation

Add this line to your application’s Gemfile:

gem 'ratatui_ruby'

And then execute:

bundle install

Or install it yourself as:

gem install ratatui_ruby

Usage

ratatui_ruby uses an immediate-mode API. You describe your UI using Ruby Data objects and call draw in a loop.

require "ratatui_ruby"
RatatuiRuby.init_terminal
begin
  RatatuiRuby.draw(
    RatatuiRuby::Paragraph.new(
      text: "Hello World",
      block: RatatuiRuby::Block.new(
        borders: [:all]
      )
    )
  )
  sleep 2
ensure
  RatatuiRuby.restore_terminal
end

For a full tutorial, see the Quickstart.

Documentation

For the full documentation on how to use ratatui_ruby, see our docs.

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 Ruby Community Conduct Guideline.

Issues for the underlying Rust library should be filed at ratatui/ratatui.

Want to help develop ratatui_ruby? Check out our contribution guide.

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.