zkit
zsh commands built on one idea: list a folder with numbers, then act on the numbers.
$ zls 1 4.0K 3y .editorconfig 2 1.2G 2mo data 3 38M 5d site <main ↑1|v2.3.0 +4> 4 ~12G 0m videos $ zcd 3 # cd site $ zupdate --all # git pull --ff-only in every repo listed $ zrm 2 # asks, then moves data to the trash
Every row gets a number, a size, how long ago it changed and, for repos, the
branch, nearest tag and ahead/behind counts. Folder sizes are cached and re-measured
in the background, so zls stays instant: ~ marks a size
being refreshed, … one not measured yet.
install
$ brew tap jonaprieto/zkit https://github.com/jonaprieto/zkit $ brew trust --formula jonaprieto/zkit/zkit $ brew install zkit $ echo 'source $(brew --prefix)/share/zkit/zkit.zsh' >> ~/.zshrc
Or clone the repo and source path/to/zkit/zkit.zsh. Needs zsh and
eza.
commands
// list
// act on the numbers
// git, per numbered repo or --all
zls [DIR]number, size, age and name of every entry, dotfiles includedzls -s | -t | -stsort by size / age, biggest or oldest last; a second letter breaks tieszls +1y | -5donly entries older / newer than that (m h d w mo y)zls -rre-measure folder sizes now and waitzcd Ncd into the numbered folder; anything else goes to plain cdzrm [FLAGS] N...confirm, then trash (no flags) or rm FLAGS the entrieszupdate N...|--all|.git pull --ff-only (or your flags), one line per repoztags N...|--all|. [-a]fetch and list tags newest first, with the branches containing themNumbers always refer to the last zls in the current shell, in the
order it was shown, so a sorted or filtered listing is what the next command acts on.
config
ZKIT_OVERRIDE=(ls rm update tags cd)orall, before sourcing: alias the plain names to the z-commands. Interactive only, never in scripts.ZKIT_HIDE=(.git .DS_Store node_modules '*.log'): leave matching names out ofzls. Hidden entries get no number.- Size cache lives in
${XDG_CACHE_HOME:-~/.cache}/zkit/du.