A command line tool for displaying delimiter-separated data as a table in the terminal.
- Takes input from stdin or a file
- Supports specifying column names or using first row as header
- Customizable delimiter (comma, tab, pipe, etc.)
- Right-align numeric columns
- Configurable header and cell colors
- Easy to use
To install tabbs, you will need Rust and Cargo installed on your system.
cargo install --path .Or install from crates.io:
cargo install tabbsPipe delimiter-separated data to tabbs and specify column names with the -c flag:
printf "jack,35,neat\njane,50,cool\nerin,20,nice" | tabbs -c "name,age,text"Output:
+------+-----+------+
| name | age | text |
+------+-----+------+
| jack | 35 | neat |
| jane | 50 | cool |
| erin | 20 | nice |
+------+-----+------+
| Option | Short | Description |
|---|---|---|
--columns |
-c |
Column names, separated by the delimiter (required unless --header-row) |
--file |
-f |
Read input from file instead of stdin |
--delimiter |
-d |
Field delimiter (default: ,) |
--header-row |
Use the first line of input as column names | |
--no-header |
Do not print the header row | |
--align-numeric |
Right-align columns that contain only numbers | |
--header-color |
Color for the header row | |
--cell-color |
Color for cell text | |
--help |
-h |
Print help |
Supported colors: black, red, green, yellow, blue, magenta, cyan, white, and their bright_ variants.
Read from a file with -f:
tabbs -f data.csv -c "name,age,city"When your data includes a header line, use --header-row instead of -c:
printf "name,age\njack,35\njane,50" | tabbs --header-rowUse --align-numeric to right-align columns where all values are numbers:
printf "name,age,score\nalice,30,95.5\nbob,25,87" | tabbs --header-row --align-numericUse -d or --delimiter for tab-separated, pipe-separated, or other formats:
# Tab-separated (use $'\t' in bash; column names must use the same delimiter)
printf "alice\t30\nbob\t25" | tabbs -c $'name\tage' -d $'\t'
# Pipe-separated
printf "alice|30\nbob|25" | tabbs -c "name|age" -d "|"printf "jack,35,neat\njane,50,cool\nerin,20,nice" | tabbs -c "name,age,text" --header-color blue --cell-color green- Simple delimiter-separated parsing only; quoted fields (e.g.
"Smith, John",42) are not supported - Rows with fewer columns than the header are padded with empty cells
- Rows with more columns than the header are truncated
- Empty lines in input are skipped
- Input is read fully into memory (very large files may use significant memory)
Contributions are welcome. Please open an issue or pull request on GitHub.
MIT License. See LICENSE for details.