A fast, minimal file finder for the desktop, written in Rust.
Gofi walks a directory once, caches the result, and lets you fuzzy-search it
from a small always-on launcher window. Pick a result, hit Enter, and your OS
opens the file with its default handler.
- Fuzzy matching via
fuzzy-matcher(skim v2 algorithm) - Persistent cache — indexes once, reloads instantly on subsequent launches
- Background search worker — typing never blocks the UI; stale queries are dropped
- Keyboard-first — arrow keys to navigate,
Enterto open,Escto clear/minimize - Global hotkey —
Alt+Spacebrings the window back to focus from anywhere - Cross-platform file opening — uses
start(Windows),open(macOS),xdg-open(Linux)
Requires a recent stable Rust toolchain (edition 2024).
cargo build --releaseThe binary lands at target/release/gofi (or gofi.exe on Windows).
# Index and search the default root (D:/ on Windows)
cargo run --release
# Or point it at any directory
cargo run --release -- C:/Users/me/projectsThe first launch walks the given directory and writes a cache to
./cache/file_hashes.bin. Delete that file to force a re-index.
| Key | Action |
|---|---|
| Type | Update search query |
↑ / ↓ |
Move selection |
Enter |
Open the selected file |
Esc |
Clear query, or minimize if already empty |
Alt+Space |
Global — restore and focus the window |
- Indexing (
src/indexing.rs) —walkdirvisits every file under the root, producing anIndexedFileper entry. Entries are grouped by base filename into aHashMap<String, Vec<IndexedFile>>and serialized withbincode. - Search (
src/main.rs::fuzzy_search) — each unique base name is scored against the query once; every path sharing that name inherits the score, minus a small penalty for path depth (shallower files rank higher). - Worker thread — the UI sends every keystroke into a
crossbeam-channel. The worker drains the channel to skip stale queries and only runs the search for the newest one, writing results back through anArc<Mutex<...>>. - Hotkey (
src/hotkey.rs) —rdevruns on a dedicated thread watching forAlt+Space, then sendsViewportCommand::Focusto the sharedegui::Context.
src/
main.rs # eframe app, search worker, file opener
indexing.rs # walkdir + bincode cache
hotkey.rs # global Alt+Space listener
cache/ # generated; gitignored
- Index is a one-shot snapshot — files added after indexing won't appear until you delete the cache and relaunch.
- The global hotkey uses
rdev::listen, which on macOS and some Linux setups requires accessibility permissions. - No configuration file yet — root path is a positional CLI argument.
Not yet specified.