Simple, slick, and fast terminal CLI to search files and directories.
- Uses streamed
rgoutput (no giant single-buffer capture). - Falls back to Go
filepath.WalkDirifrgis not installed. - Uses a top-K heap for ranking (keeps only best
-limitmatches in memory). - Keeps files and directories in separate indexes so empty directories can be found.
go build -o tsearch ../tsearch [flags] # interactive by default
./tsearch [flags] <query> # runs first query, then stays interactiveInteractive UI:
-ui auto(default): usesfzfwhen available in a real TTY, otherwise plain prompt mode.-ui fzf: forcefzfTUI.-ui plain: force line-prompt mode.
fzf key bindings:
EnterorCtrl-O: open selected path in your editorCtrl-Y: copy selected path to clipboardCtrl-R: reindex and refresh list
Text content search:
./tsearch -text "needle" -glob '*.txt'
./tsearch -root /path -text "password" -glob '*.md'Output format:
/absolute/path <dir>/absolute/path <file>-format plainprints only paths, one per line-format jsonlprints one JSON object per result-0prints NUL-separated paths for shell pipelines
Wildcard search:
*matches any sequence of characters?matches a single character- Example:
'*.txt'(quote wildcard in shell)
Ranking:
- Exact basename and path-segment matches rank higher than embedded matches.
- Matching is case-insensitive UTF-8 byte matching; it does not normalize Unicode.
Color coding:
- Directories: cyan
- Go files: bright green
- Code files: blue
- Config files: magenta
- Docs: gray
- Archives: red
- Images: bright magenta
- Media/executable/hidden files have their own styles
-rootroot directory to search (default current directory)-typefile|dir|all(defaultall)-limitmax results (default100)-hiddeninclude hidden files-no-ignoreignore.gitignoreand other ignore rules-colorauto|always|never(defaultauto)-iforce interactive mode (reloadcommand refreshes the index)-textsearch text inside files (content search mode)-globfilter indexed/searched files by glob (e.g.*.txt)-progressshow progress during large scans/matches (defaulttrue)-oncerun a single query and exit-uiinteractive UI mode:auto|plain|fzf-editoreditor command for open action (default$VISUAL/$EDITOR)-formatoutput format:human|plain|jsonl(defaulthuman)-0use NUL-separated plain paths
# Search both files and directories
./tsearch auth
# One-shot mode (exit directly after output)
./tsearch -once auth
# Interactive search in current directory
./tsearch
# Files only
./tsearch -type file handler
# Directories only
./tsearch -type dir srcapi
# Search another root
./tsearch -root ~/projects client
# Wildcard search
./tsearch '*.txt'
# Search text inside text files
./tsearch -root ~/projects -text "TODO" -glob '*.txt'
# Interactive mode
./tsearch -i -root ~/projects
# Force fzf TUI + custom editor
./tsearch -ui fzf -editor "nvim" -root ~/projects