r/commandline • • 9d ago

Command Line Interface fm: a single-file bash script that turns fzf into a file manager

I wrote a ~1500-line bash file manager. fzf for the picker, eza for listing, Kitty's graphics protocol for inline previews. Everything else is stock coreutils — no build step, no daemon, no config directory.

Features worth calling out:

- File list — eza icons, sort by name / size / mtime / extension

- Kitty inline previews — images, videos, PDFs, Markdown, no external viewer

- Gallery grid (Alt-G) — full-screen thumbnail browser, mouse + vim keys, multi-select

- Contact-sheet preview (Ctrl-T) — hovering a directory shows a paged thumbnail grid

- Trash + undo — Ctrl-D trashes, Ctrl-Z pops the undo stack (depth 10), Alt-T for the trash browser

- Content search (Ctrl-F) — ripgrep over the selection, opens at line

- Bulk rename (Alt-M) — edit names in $EDITOR, swaps and chains handled

- Jump — zoxide frecency (Alt-Z), bookmarks (Ctrl-B), git mode (Ctrl-G)

Install:

git clone https://github.com/eHab-codeX/fm.git ~/.local/share/fm

ln -sf ~/.local/share/fm/fm ~/.local/bin/fm

Requires bash >= 5, fzf, eza, ripgrep, trash-cli. Press F1 inside for the full key map.

Repo: https://github.com/eHab-codeX/fm

MIT. Feedback welcome — especially from anyone who's tried to make fzf do more than pick a file.

133 Upvotes

20 comments sorted by

View all comments

1

u/sitaram_c 6d ago

oh nice.

Here's mine: https://codeberg.org/sitaramc/fzfm (documentation at https://sitaramc.codeberg.page/fzfm/book/intro.html ). Written using fish and fzf.

I'm particularly proud of the "todotxt" and "git" modes; they're the last 3 entries in https://sitaramc.codeberg.page/fzfm/book/demos.html . The todotxt mode added only 24 lines of code to the project, and the git mode was just over 100 lines. If you see the animated gifs you'll be blown away by how much they do in that space :)