nibble-rs

Crates.ionibble-rs
lib.rsnibble-rs
version0.0.6
created_at2025-12-09 12:47:53.49917+00
updated_at2025-12-16 13:25:20.569706+00
descriptionA tool for glamorous shell scripts. Quick, inline TUI components built with Ratatui—no full-screen takeover, just small bites of interaction.
homepage
repositoryhttps://github.com/Vaishnav-Sabari-Girish/nibble
max_upload_size
id1975427
size86,437
Vaishnav-sabari-girish (Vaishnav-Sabari-Girish)

documentation

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

Crates.io License Minimum Supported Rust Version

Changelog

To view the changelog go to CHANGELOG.md for more details

Installation

cargo install nibble-rs

Usage

Widgets

Currently nibble supports the following widgets

Block

nibble block --title "Block Widget" --border rounded --border-color cyan --height 7

Gives you this output

block

Gauge

nibble gauge -v 75 --title "Progress" --border double --fg green --modifier bold --time 120

Gives you this output

gauge

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

table

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"]
]

Input

Single-line text input field with support for prompts, placeholders, passwords, and character limits.

Basic Input:

nibble input --prompt "Name:" --placeholder "Enter your name"

basic input

Password Input:

nibble input --prompt "Password:" --password --border double

pwd

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 

basic_confirm

Custom Text with Custom options

# Custom Text
nibble confirm --text "Continue ?"

# Custom options
nibble confirm --text "Continue ?" --affirmative "Proceed" --negative "Cancel"

custom_confirm

Select No by default

nibble confirm --text "Continue ?" --affirmative "Proceed" --negative "Cancel" --default-no

no_default

Commit count: 0

cargo fmt