Readme
Table of Contents generated with DocToc
Nibble
A tool for glamorous shell scripts. Quick, inline TUI components built with Ratatui—no full-screen takeover, just small bites of interaction.
This tool was inspired by gum
Changelog
To view the changelog go to CHANGELOG.md for more details
Installation
cargo install nibble-rs
Usage
Currently nibble supports the following widgets
Block
nibble block -- title " Block Widget" -- border rounded -- border-color cyan -- height 7
Gives you this output
Gauge
nibble gauge - v 75 -- title " Progress" -- border double -- fg green -- modifier bold -- time 120
Gives you this output
Table
Display tabular data inline with customizable styling and multiple data formats.
This below command
nibble table -- data " Name,Age,City;Alice,30,NYC;Bob,25,LA;Carol,28,SF" - t " Users" -- highlight-header
Will output this
Inline Data:
nibble table -- data " Name,Age,City;Alice,30,NYC;Bob,25,LA;Carol,28,SF" -- title " Users" -- highlight-header
From CSV File:
nibble table -- file data.csv -- title " CSV Data" -- height 12 -- border rounded -- fg cyan
From JSON File:
nibble table -- file users.json -- title " Users" -- highlight-header -- border double
With Custom Column Widths:
nibble table - d " Product,Price,Stock;Laptop,999,50;Mouse,25,200" - w " 50,25,25" - t " Inventory"
Supported Formats:
Inline data : Use semicolons (; ) for rows and commas (, ) for columns
CSV files : Standard comma-separated values
JSON files : Array of objects [ { " name" : " Alice" , ... } ] or array of arrays [ [ " Name" , " Age" ] , [ " Alice" , 30 ] ]
Key Options:
--data, -d : Inline data string
--file, -f : Path to CSV or JSON file
--headers : Custom column headers (comma-separated)
--widths, -w : Column widths as percentages (comma-separated, must sum to ≤100)
--highlight-header : Bold the header row
--height : Table height in lines (default: 10)
--title , -t : Title for the table block
Example JSON (array of objects):
[
{ " name" : " Alice" , " age" : 30 , " city" : " NYC" } ,
{ " name" : " Bob" , " age" : 25 , " city" : " LA" }
]
Example JSON (array of arrays):
[
[ " Name" , " Age" , " City" ] ,
[ " Alice" , 30 , " NYC" ] ,
[ " Bob" , 25 , " LA" ]
]
Single-line text input field with support for prompts, placeholders, passwords, and character limits.
Basic Input:
nibble input -- prompt " Name:" -- placeholder " Enter your name"
Password Input:
nibble input -- prompt " Password:" -- password -- border double
With Character Limit and Counter:
nibble input -- prompt " Username:" -- max-length 20 -- show-count -- border rounded -- fg cyan
Pre-filled Value:
nibble input -- prompt " Email:" -- value " user@example.com" -- show-count
Styled Input:
nibble input -- title " User Input" -- prompt " City:" -- placeholder " New York" -- border thick -- fg green
Key Options:
--prompt , -r : Label text displayed before the input field
--placeholder, -p : Placeholder text shown when input is empty
--value, -v : Initial/pre-filled value
--title , -t : Title for the input block
--password : Masks input with asterisks (does not print output)
--max-length, -m : Character limit
--show-count, -c : Display character counter
--height : Widget height in lines (default: 3)
Confirm
Interactive confirmation prompt with Yes/No buttons. Returns exit code 0 for Yes and 1 for No.
Basic Confirm
# Default confirm
nibble confirm
Custom Text with Custom options
# Custom Text
nibble confirm --text "Continue ?"
# Custom options
nibble confirm --text "Continue ?" --affirmative "Proceed" --negative "Cancel"
Select No by default
nibble confirm -- text " Continue ?" -- affirmative " Proceed" -- negative " Cancel" -- default-no