tennis is a small CLI for printing stylish CSV tables in your terminal. Rows will be truncated to fit and it'll automatically pick nice colors to match your terminal. Written in Zig. Demo:
$ brew install gurgeous/tap/tennisDownload a binary from https://github.com/gurgeous/tennis/releases. Copy into your path somewhere. I like to use ~/.local/bin personally. Also see the (optional) bash/zsh completions and man page in extra/.
# this will build zig-out/bin/tennis
$ mise trust && mise install
$ zig build- auto-layout to fit your terminal window
- auto-themes to pick light or dark based on your terminal background
- auto-format numbers
- auto-detect csv vs tsv (or semis, or pipes)
- titles, row numbers, border styles...
Usage: tennis [options...] <file.csv> # print file.csv
tennis [options...] # print csv from stdin
-n, --row-numbers Turn on row numbers
-t, --title <string> Add a title to the table
--border <border> Table border style (rounded|thin|double|...)
--color <color> Turn color off and on (on|off|auto)
--completion <shell> Print a shell completion script (bash|zsh)
--delimiter <char> CSV delim (can be any char or "tab")
--digits <int> Digits after decimal for float columns (1-6)
--head <int> Show first N rows
--tail <int> Show last N rows
--theme <theme> Select color theme (auto|dark|light)
--vanilla Disable numeric formatting entirely
--width <int> Set max table width in chars
--help Get help
--version Show version number and exit
Note that color defaults to on. Tennis likes to be colorful.
tennis uses a termbg.zig module to detect the terminal background color so it can choose the correct theme (dark or light). Detection is complicated, and I'm calling it out here because I don't think anyone has implemented this in Zig yet.
- support for input.json (and maybe ndjson/jsonl)
- show first/last rows -
--head,--tail - sort rows -
--sort - select cols -
--onlyor--color--columnsor--select - pipe through less -
--pager - add zebra stripes -
--zebra - output markdown
--format markdownor--markdown - watch a file, update display
--watch - briefly summarize each col
--summaryor--peek
We love CSV tools and use them all the time! Here are a few that we rely on:
- bat - syntax highlights csv files, and many others
- csvlens, tabiew & tidy viewer - great viewers for CSV files, beautiful and fun
- miller - csv processing and transformation
- nushell - modern shell with first-class structured table data
- qsv - filter, sort, combine, join... (a fork of xsv)
- Terminal::Table - wonderful rubygem for pretty printing tables, great for non-hash data like confusion matrices
- visidata - the best for poking around large files, it does everything
- table_tennis - my own project, the basis for this one
--borderstyles based on Nushell /tabledcrate.--completionfor auto-generating bash/zsh completions--headand--tailfor clipping large tablesdoomicode, best-effort Unicode width for emojis, etc- auto-detect csv vs tsv (or semis, or pipes)
- Custom
--delimiterfor tsv, semicolon, etc. #5 (@markhm) - Auto numeric formatting, including delims and rounding for int/float columns. Disable with --vanilla.
- man page & shell completions
- Initial release.
- termbg and termenv for showing how to safely detect the terminal background color. These libraries are widely used for Rust/Go, but as far as I know nothing similar exists for Zig.
- I copied the header color themes from tabiew. Great project!
- Border styles pinched from nushell and tabled crate. Thanks guys!

