Categories: None [Edit]
rooibos
== Confidently Build Terminal Apps
Rooibos[https://rooibos.run] helps you build interactive terminal applications.
Keep your code understandable and testable as it scales. Rooibos handles
keyboard, mouse, and async work so you can focus on behavior and user experience.
gem install rooibos
Currently in beta. APIs may change before 1.0.
=== Get Started in Seconds
rooibos new my_app
cd my_app
rooibos run
That's it. You have a working app with keyboard navigation, mouse support,
and clickable buttons. Open lib/my_app.rb to make it your own.
---
=== The Pattern
\Rooibos uses Model-View-Update, the architecture behind
Elm[https://guide.elm-lang.org/architecture/],
Redux[https://redux.js.org/], and {Bubble
Tea}[https://github.com/charmbracelet/bubbletea].
State lives in one place. Updates flow in one direction. The runtime handles
rendering and runs background work for you.
---
=== Hello, MVU
The simplest \Rooibos app. Press any key to increment the counter. Press
Ctrl+C to quit.
require "rooibos"
module Counter
# Init: How do you create the initial model?
Init = -> { 0 }
# View: What does the user see?
View = -> (model, tui) { tui.paragraph(text: <<~END) }
Current count: #{model}.
Press any key to increment.
Press Ctrl+C to quit.
END
# Update: What happens when things change?
Update = -> (message, model) {
if message.ctrl_c?
Rooibos::Command.exit
elsif message.key?
model + 1
end
}
end
Rooibos.run(Counter)
That's the whole pattern: Model holds state, Init creates it, View renders it,
and Update changes it. The runtime handles everything else.
---
=== Your First Real Application
A file browser in sixty lines. It opens files, navigates directories, handles
errors, styles directories and hidden files differently, and supports vim-style
keyboard shortcuts. If you can do this much with this little code, imagine how
easy _your_ app will be to build.
require "rooibos"...
Total
Ranking: 183,745 of 189,366
Downloads: 908
Daily
Ranking: 58,821 of 189,320
Downloads: 1
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
| Rank | Downloads | Name |
|---|
Depends on
| Rank | Downloads | Name |
|---|---|---|
| 11 | 1,203,157,911 | concurrent-ruby |
| 153 | 305,201,738 | faker |
| 176 | 271,677,899 | rdoc |
| 2,240 | 9,968,805 | concurrent-ruby-edge |
| 20,179 | 80,287 | minitest-mock |
| 104,528 | 7,508 | ratatui_ruby |
Owners
| # | Gravatar | Handle |
|---|---|---|
| 1 | Kerrick |