Interact with this post using Mastodon or
A complete cli file manager: yazi
Published on
Like everyone else, I’ve started navigating and managing my files with GUI apps, but soon realized that a CLI tool would better integrate into my workflow. Then I encountered some limitations and used the power of zsh to complete this task directly from the commandline.
I kept an eye open for any CLI alternatives though, because in a few circumstances large file manipulations were still tricky. I’ve tried different approaches, but one thing that definitely brought me back to the straight commandline is the fuzzy find search (fzf
), until I came across yazi
.
After few months of daily use, I think I can recommend it.
╭── Features that sold me on yazi
From the project page, here are the features I was first attracted with:
- all I/O operations are asynchronous
- provides real-time progress updates, task cancellation, and internal task priority assignment
- integration with ripgrep, fd, fzf
- multi-tab support, cross-directory selection, scrollable preview (for videos, PDFs, archives, code, directories, etc.)
- bulk renaming
Here are some additional features you may also like:
- built-in support for multiple image protocols, and also integrated with Überzug++ and Chafa
- built-in code highlighting and image decoding
- integration with zoxide
- UI plugins to rewrite most of the UI, functional plugins, custom previewer/preloader/spotter/fetcher
- which-key feature
But yazi
is way more than this short list of features. Walking you through it will take hours. You can take a look at the great documentation on the project page, and also watch this two great overviews:
(source: https://www.youtube.com/watch?v=cUwu3mkrz_k
)
(source: https://www.youtube.com/watch?v=l44HjrTQHGc )
╭── Searching is vital
As I mentioned, a good search support is important to me. Here again, yazi
couldn’t have done it better. It offers:
- file searching (using
fd
) - file content searching (using
rg
) - file subtree navigation (using
fzf
)
This will cover any search needs one may have. I use fzf
all over the place, so having a file manager that supports it is really what made me fall in love with yazi
.
Additionally, you can also:
- filter the files by pattern
- sort the files alphabetically/by extension/by creation/by modification date (normal or reverse)
╭── A good tool is a customizable tool
Yazi
is fully customizable through three config files:
- yazi.toml to mess up the UI
- theme.toml to adjust all colors individually
- keymap.toml to remap all keybindings to your liking
Most keybindings are pretty obvious, but I’d like to share here the ones I’ve created to use trash-cli
(note that I’m using tmux also):
{ on = "d", run = "shell --confirm 'trash-put $@'", desc = "Trash selected files" },
{ on = "R", run = "shell --confirm 'tmux popup -E \"trash-restore\"'", desc = "Restore trashed files" },
{ on = "T", run = "shell --confirm 'tmux popup -E \"trash-list && trash-empty\"'", desc = "Empty trash" }
I’ve also tweaked the paste command to deselect files when the action is completed:
{ on = "p", run = ["paste", "unyank"], desc = "Paste yanked files" }
╭── Conclusion
I was yet not able to find the limits of yazi
for my needs. I still have the reflex to perform simple actions directly from the commandline because of muscle memory and also because it’s faster, but as soon as I need to work on multiple files or across several directories I love using yazi
.
Thanks for your read. Hope it's been useful to you.
✄ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈ ┈
More food for thoughts? Check other posts about: #Cli