2 unstable releases
Uses new Rust 2024
| 0.4.0 | Oct 18, 2025 |
|---|---|
| 0.3.0 | Oct 17, 2025 |
| 0.2.1 |
|
| 0.1.3 |
|
#1363 in Filesystem
320KB
9K
SLoC
-- UNDER CONSTRUCTION --
frz
TUI fuzzy finder revolving around tabular data, utilising Saghen's Frizbee crate for matching.
Features
- Interactive TUI built on
ratatui. - Uses
frizbeefuzzy matching for typo-tolerant search. - Builder-style API to configure prompts, column headers and widths.
- Ready-to-use filesystem scanner (
SearchUi::filesystem) that walks directories recursively. - Multi-threaded filesystem traversal powered by the
ignorecrate with built-in.gitignoresupport. - Rich outcome information including which entry was selected and the final query string.
Architecture
frz is split into three layers: infrastructure systems, plugins, and the TUI
application. crates/plugin-api/ defines the stable plugin surface, including
descriptors and the SearchPlugin trait. crates/tui/ offers reusable widgets
and helpers for rendering plugin output. The binary crate in src/ wires these
pieces together, initialises background systems, and registers built-in plugins
via register_builtin_plugins.
Quick example
use frz::{SearchData, SearchUi, UiConfig};
use frz::plugins::builtin::files;
let data = SearchData::from_filesystem(".")?;
let outcome = SearchUi::new(data)
.with_ui_config(UiConfig::tags_and_files())
.with_start_mode(files::mode())
.run()?;
if let Some(file) = outcome.selected_file() {
println!("Selected file: {}", file.path);
}
Run the examples
cargo run -p frz --example demo
cargo run -p frz --example filesystem -- /path/to/project
Command-line application and configuration
The crate now ships with a frz binary that provides a ready-to-use filesystem
search experience. You can explore the available options with:
cargo run -- --help
frz loads configuration from a layered set of sources:
~/.config/frz/config.toml(or the platform-specific directory reported bydirectories::ProjectDirs).$FRZ_CONFIG_DIR/config.tomlif the environment variable is set../.frz.tomlfollowed by./frz.tomlin the current working directory.- Any files passed via
--config <path>(later files win). - Environment variables prefixed with
FRZ_using__as a separator (for exampleFRZ_FILESYSTEM__INCLUDE_HIDDEN=false). - Explicit command-line flags.
A minimal configuration might look like this:
[filesystem]
root = "~/projects/frz"
include_hidden = false
allowed_extensions = ["rs", "toml"]
[ui]
theme = "solarized"
start_mode = "files"
detail_panel_title = "Entry details"
You can inspect the resolved configuration before launching the TUI via
--print-config, list available themes with --list-themes, or emit the final
selection as pretty JSON using --output json.
Extending via plugins
- Plugins can register new tabs by implementing
SearchPluginand adding them to aSearchPluginRegistry. Each plugin exposes aSearchPluginDescriptorthat advertises UI copy, table layout metadata, and an associatedSearchPluginDatasetimplementation; the dataset abstraction lets plugins describe how to render their tables, report aggregate counts, and contribute progress information, enabling the registry to treat every plugin uniformly regardless of how many are registered. - Registries preserve insertion order, making it easy to deterministically compose built-in and custom tabs. They also expose helpers such as
SearchPluginRegistry::deregisterandSearchPluginRegistry::plugin_by_idso applications can swap out built-in implementations or target plugins by their identifier without having to manage bookkeeping themselves. - Reusable background capabilities live under the
plugins::systemsmodule. The search worker is available viaplugins::systems::search, which exposes theSearchStreamtype and helpers for streaming attributes and files using the built-in matching pipeline. The filesystem indexer is exposed throughplugins::systems::filesystem, which providesFilesystemOptions,spawn_filesystem_index, and themerge_updatehelper for applying incremental results toSearchData.
Dependencies
~26–59MB
~1M SLoC