{"id":21273547,"url":"https://github.com/unkwusr/nctok","last_synced_at":"2025-03-15T12:41:59.803Z","repository":{"id":235490341,"uuid":"779422546","full_name":"UnkwUsr/nctok","owner":"UnkwUsr","description":"A program for interactive navigating through weighted hierarchical structured data and analyzing them","archived":false,"fork":false,"pushed_at":"2024-04-24T06:54:25.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-24T18:19:12.379Z","etag":null,"topics":["hierarchy","menu","navigation","sort","terminal","tree","tui","weighted"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UnkwUsr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-29T20:01:46.000Z","updated_at":"2024-04-24T06:54:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"39f106c8-e705-4e2b-b75f-eef0111539fc","html_url":"https://github.com/UnkwUsr/nctok","commit_stats":null,"previous_names":["unkwusr/nctok"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnkwUsr%2Fnctok","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnkwUsr%2Fnctok/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnkwUsr%2Fnctok/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnkwUsr%2Fnctok/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UnkwUsr","download_url":"https://codeload.github.com/UnkwUsr/nctok/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243732252,"owners_count":20338831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hierarchy","menu","navigation","sort","terminal","tree","tui","weighted"],"created_at":"2024-11-21T09:15:23.028Z","updated_at":"2025-03-15T12:41:59.795Z","avatar_url":"https://github.com/UnkwUsr.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nctok\n\nA TUI utility for interactive exploring weighted hierarchical structured data.\n(\"weighted\" means that each item have its own value - number)\n\nDue to simplicity of input format, it's easy to write your own scripts that\nproduces data you want to analyze, fast, right in the shell. See\n[examples](doc/examples.md).\n\n## What?\n\nAny hierarchical structured data, with fields having weights (number\ncharacteristic). Imagine filesystem with file size being weight characteristic.\nWhen displaying, each level items gets sorted by weight (sum of weights of\nchildren items). This way you see \"heaviest\" (= with max weight) item at each\nlevel of hierarchy.\n\n## Demo\n\nFile space usage (files size):\n\n![](https://github.com/UnkwUsr/nctok/assets/49063932/046a4cea-c37d-4827-bbc5-d523ffb58f43)\n\nGit commits count per file, linux kernel 6.8 repo:\n\n![](https://github.com/UnkwUsr/nctok/assets/49063932/c30daaed-c873-4d74-bef1-ba3b714fb9ba)\n\n## Features\n\n* interactive navigation\n* items sorted by their recursive weight-sums\n* accepts any data from stdin, so you can easily make your owns (see\n  [examples](doc/examples.md))\n  * input format can be altered (see [configuration](#configuration) section)\n* interface:\n  * preview window (can be toggled)\n  * human-readable big numbers formatting (can be toggled)\n\n## Usage\n\n```shell\n... | nctok\n```\n\nWhere `...` should produce output in format:\n\n```\n\u003cnumber\u003e \u003cpath/to/item\u003e\n\u003cnumber\u003e \u003cpath/to/another_item\u003e\n```\n\nFor concrete usecases see [examples](doc/examples.md).\n\n### Keys/control\n\n* `j`/`k` - go down/up in list\n* `l`/`h` - go deep down/up (inside/out)\n* `g` - go to top (very first item)\n* `G` - go to bottom (latest item)\n* `w` - toggle preview window\n* `a` - toggle human-readable numbers formatting\n* `q` - quit\n\n## Configuration\n\n```\n$ nctok --help\n...\nOptions:\n      --reverse  Invert sort order\nParser:\n      --number-delimiter \u003cNUMBER_DELIMITER\u003e\n          Delimiter between items number value and path [default: \" \"]\n      --path-separator \u003cPATH_SEPARATOR\u003e\n          Separator in items path [default: /]\nInterface:\n      --preview\n          Show preview window for entry under cursor (can also toggle with 'w' key)\n      --no-human-readable\n          Disable formatting big numbers in human-readable (can also toggle with 'a' key)\n```\n\n## Installation\n\n### On Arch Linux\n\nAUR package: [nctok-git](https://aur.archlinux.org/packages/nctok-git/)\n\n### With cargo (from [crates.io](https://crates.io/crates/nctok))\n\n```shell\ncargo install nctok\n```\n\n### From sources\n\n```shell\ncargo install --path .\n```\n\n## Inspiration\n\n* [ncdu](https://dev.yorhel.nl/ncdu) - (ncurses) disk usage analyzer. This is\n  main source of inspiration. I took exactly their idea and made unified\n  interface for analyzing any data with the same (and a bit better) interface.\n* [vifm](https://github.com/vifm/vifm) - terminal file manager. I took preview\n  window from it.\n* [tokei](https://github.com/XAMPPRocky/tokei) - lines-of-code counter. Well,\n  at very first I wanted tokei+ncdu experience, so this project was born.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funkwusr%2Fnctok","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funkwusr%2Fnctok","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funkwusr%2Fnctok/lists"}