A TUI utility for interactive exploring weighted hierarchical structured data. ("weighted" means that each item have its own value - number)
Due to simplicity of input format, it's easy to write your own scripts that produces data you want to analyze, fast, right in the shell. See examples.
Any hierarchical structured data, with fields having weights (number characteristic). Imagine filesystem with file size being weight characteristic. When displaying, each level items gets sorted by weight (sum of weights of children items). This way you see "heaviest" (= with max weight) item at each level of hierarchy.
File space usage (files size):
Git commits count per file, linux kernel 6.8 repo:
- interactive navigation
- items sorted by their recursive weight-sums
- accepts any data from stdin, so you can easily make your owns (see
examples)
- input format can be altered (see configuration section)
- interface:
- preview window (can be toggled)
- human-readable big numbers formatting (can be toggled)
... | nctok
Where ...
should produce output in format:
<number> <path/to/item>
<number> <path/to/another_item>
For concrete usecases see examples.
j
/k
- go down/up in listl
/h
- go deep down/up (inside/out)g
- go to top (very first item)G
- go to bottom (latest item)w
- toggle preview windowa
- toggle human-readable numbers formattingq
- quit
$ nctok --help
...
Options:
--reverse Invert sort order
Parser:
--number-delimiter <NUMBER_DELIMITER>
Delimiter between items number value and path [default: " "]
--path-separator <PATH_SEPARATOR>
Separator in items path [default: /]
Interface:
--preview
Show preview window for entry under cursor (can also toggle with 'w' key)
--no-human-readable
Disable formatting big numbers in human-readable (can also toggle with 'a' key)
AUR package: nctok-git
With cargo (from crates.io)
cargo install nctok
cargo install --path .
- ncdu - (ncurses) disk usage analyzer. This is main source of inspiration. I took exactly their idea and made unified interface for analyzing any data with the same (and a bit better) interface.
- vifm - terminal file manager. I took preview window from it.
- tokei - lines-of-code counter. Well, at very first I wanted tokei+ncdu experience, so this project was born.