Hacker News new | ask | show | jobs
by mieubrisse 350 days ago
Good question! This is complementary, not competitive, to the built-in fzf shortcuts. I use both cmdk and built-in fzf shortcuts in my day-to-day.

The concrete value-adds of cmdk (what fzf doesn't do out of the box):

1. Smart previews. You have to write the fzf preview command to preview text files, directories, images, PDFs, etc. cmdk gives you this out of the box (see https://github.com/mieubrisse/cmdk/blob/main/preview.sh ).

2. Choose the command for you. If you rely on the fzf Ctrl-T shortcut, you have to type the `cd`, the `vim`, the `open`, etc. I find that most of the time the command is predictable based on the filetype, so cmdk allows you to skip this (see https://github.com/mieubrisse/cmdk/blob/9d742112dab0475d7420... ). When cmdk doesn't have a command for the filetype though, I supplement with fzf's Ctrl-T.

3. Be smart about which files you're searching to be performant. E.g. very likely users aren't going to jump to files in the "~/Library/Application Support", or certain system directories under "/", so give users the option to go to the parent directory without crawling the subdirectories (see https://github.com/mieubrisse/cmdk/blob/main/list-files.sh ).