Project

hawktui

0.01
No release in over a year
Use this gem to build TUIs in Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 1.4.7
 Project Readme

Hawktui

Hawktui is a simple and easy to use TUI (Terminal User Interface) library for Ruby. It is built on the curses library.

hawktui

So far it includes a StreamingTable API and more APIs are planned.

Installation

Add this line to your application's Gemfile:

gem "hawktui"

Run the following command to install it:

bundle install

StreamingTable

The Hawktui::StreamingTable API can be used to create a full screen table in your terminal that can be updated in real time. This is useful for displaying data that is constantly changing.

git clone https://github.com/jonmagic/hawktui
cd hawktui
bin/setup
bin/demo
CleanShot.2025-01-03.at.10.02.32-converted.mp4

See bin/demo for an example of how to use Hawktui::StreamingTable and the implementation in lib/hawktui/streaming_table.rb for documentation.

Roadmap

  • Add functionality to StreamingTable for selecting and acting on rows.

Development

Run the tests with:

rake

Run the standard linter and fix issues with:

rake standard:fix

I use LLMs a lot so I've added a couple of scripts that make it easier to write prompts.

  • bin/code_for_prompt - This script will output everything in lib and test that you might need when providing a prompt with context. I usually pipe this to pbcopy and then paste it into the prompt.
    bin/code_for_prompt | pbcopy
  • bin/token_count - This script will output the number of tokens either piped to it or by running whatever is passed to it as a command. It defaults to counting for ChatGPT 4o but you can set the model to claude instead. Run the command without arguments to see the usage.
    bin/code_for_prompt | bin/token_count

Contributing

Pull Requests are welcome. If you find a bug or have a feature request I encourage you to follow the instructions above and then try out an LLM tool like GitHub Copilot, ChatGPT, or Claude to help you fix the bug or write the feature. Version 1 of this library was written entirely using LLMs, from feature ideas to bug fixes.

Prompt driven development (aka PBD or PDP) is the future 🚀

Contributors