This is the beautiful, nice, nifty, fancy, neat, pretty, cool, rich, lovely, natty user interface you like to have for your command line applications. It contains elegant, simple and beautiful tools that enhance your command line interfaces functionally and aesthetically.
- Gem: rubygems.org
- Source: github.com
- Help: rubydoc.info
Here you find elegant, simple and beautiful tools that enhance your command line application functionally and look.
You can style your text using a BBCode-like syntax
ui.puts '[b]Hello World![/b]' # bold
ui.puts '[i]Hello World![/i]' # italic
ui.puts '[u]Hello World![/u]' # underline
ui.puts '[yellow on_blue]Hello World![/]'
which supports all ANSI attributes, colors in 3/4-bit, 8-bit and Truecolor. There are headers, rulers, diverse message types, framed blocks and tables to layout your text. You can organize the output of tasks, use progress bars and request and handle user input. And there are text animations for fame and fun!
🚀 Have a look at the features or check the code examples!
NattyUI follows the NO_COLOR convention.
📕 See the online help and have a look at the examples directory to learn from code.
You can execute the examples by
ruby ./examples/demo.rb
or see the non-ANSI version
NO_COLOR=1 ruby ./examples/demo.rb
You can install the gem in your system with
gem install natty-ui
or you can use Bundler to add NattyUI to your own project:
bundle add natty-ui
After that you only need one line of code to have everything together
require 'natty-ui'