Modern CLI tools
- linux bsd cli
The CLI tools ecosystem is very alive, I feel this trend restarted with the Go and Rust languages, for the best.
I’ve used some CLI commands for multiple decades, it’s hard to force new habits, but some of those new tools really justify some efforts.
This is a list of some I’ve adopted already or trying to adopt, obviously opiniated choices:
Yazi Terminal file manager You can select multiple file with
space
then open them usingenter
.
Yazi can preview images if your terminal is suporting it.Here is an alias I load from my shell, that changes the shell current dir using the one Yazi was into before quitting.
function y() {
tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
cd -- "$cwd"
fi
rm -f -- "$tmp"
}
Example .config/yazi/yazi.toml
to open your editor:
[opener]
text = [
{ run = 'helix "$@"', block = true },
]
[open]
rules = [
{ mime = "text/*", use = "text" },
{ name = "*.go", use = "text" },
]
- Curlie replaces curl Curlie is using the same options as httpie but is a Go frontend command calling curl.
alias http="curlie"
http -v -k POST https://localhost:8443 user=xx
Helix modal editor ala vim.
Don’t be intimidated by the fact it is changing some of the vi keymaps, it’s for the best (selection → action).I’m used to maintain a complex vim setup with a lot of plugins.
All gone with helix, it’s a vim like that just give me 99% of what I need builtin. Helix could justify a full blog post by itself.On linux you should probably alias helix to hx (like on OSX).
Bat cat + less + formatting
k -n myns logs envoy-ext-jwt-auth-9b7557f74-2dskf | bat -l json alias less='bat -p'
Kitty not just a terminal but a multiplexer as well, I’m using tmux less and less.
A workfow I’m using a lot is connecting to a remote host using ssh, and open a new tab or window direclty on the remote host, using the following alias:kitty-reload() { kill -sigusr1 $(pidof kitty) } alias ssh='kitten ssh'
gitui like tig or lazygit, but I find it simpler to use without the need to remember shortcuts, (you can navigate by using
tab
).tz displays a quick view of the different timezones.
alias tz='TZ_LIST="UTC;Europe/Paris,France;US/Pacific;Asia/Shanghai,China" tz -m -q'
rg Not new, but great replacement for grep -R especially for source code.
fzf A fuzzy finder for your shell and more.
zenith, top, htop alternative.
zenith -n 0 -d 0
fx better jq, with an interactive mode where you can find the path of what you are trying to filter.
dasel Select, put and delete data from JSON, TOML, YAML, XML and CSV
fd An alternative to find, hard to get rid of the
find -name
orfind -exec cmd {} \;
, but fd is easier.fd txt --exec wc -l
numbat really useful tool to convert and compute any units.
I’m using it to convert UNIX epoch, but also to compute bandwith vs time.from_unixtime(1708967421) + 2 day = Wed, 28 Feb 2024 12:10:21 -0500 [DateTime]