match-maker

Crates.iomatch-maker
lib.rsmatch-maker
version0.0.5
created_at2025-11-11 00:59:32.97093+00
updated_at2026-01-14 13:27:02.167392+00
descriptionA fuzzy finder for the terminal, powered by nucleo
homepage
repositoryhttps://github.com/Squirreljetpack/matchmaker
max_upload_size
id1926516
size394,606
(Squirreljetpack)

documentation

README

m&m Crates.io License

Matchmaker is a fuzzy searcher, powered by nucleo and written in rust.

(pitch + fzf credit: todo)

Features

  • Matching with nucleo.
  • Declarative configuration sourced from a toml file. (Cli parsing not yet implemented.)
  • Interactive preview supports color, scrolling, wrapping, multiple layouts, and even entering into an interactive view.
  • FZF-inspired actions.
  • Column support: Split input lines into multiple columns, that you can dynamically search, filter, highlight, return etc.
  • Available as a rust library to use in your own code.

Installation

cargo install match-maker # note the hyphen!

Pass it some items:

find . | mm

[!NOTE] The default input and preview commands rely on fd, bat and eza. For an optimal experience, install them or update your configuration.

Configuration

To begin, you can dump the default configuration to a file:

matchmaker --dump-config

The default locations are in order:

  • ~/.config/matchmaker/config.toml (If the folder exists already).
  • {PLATFORM_SPECIFIC_CONFIG_DIRECTORY}/matchmaker (Generally the same as above when on linux)

Keybindings

All actions must be defined in your config.toml.

The list of currently supported actions can be found here.

To get the names of keys, type matchmaker --test-keys.

In addition to keys, actions can also be bound to Events and Crossterm events (check your default config for details).

Library

Matchmaker can also be used as a library.

cargo add matchmaker

Example

Here is how to use Matchmaker to select from a list of strings.

use matchmaker::nucleo::{Indexed, Worker};
use matchmaker::{MatchError, Matchmaker, Result, Selector};

#[tokio::main]
async fn main() -> Result<()> {
    let items = vec!["item1", "item2", "item3"];

    let worker = Worker::new_single_column();
    worker.append(items);
    let selector = Selector::new(Indexed::identifier);
    let mm = Matchmaker::new(worker, selector);

    match mm.pick_default().await {
        Ok(v) => {
            println!("{}", v[0]);
        }
        Err(err) => match err {
            MatchError::Abort(1) => {
                eprintln!("cancelled");
            }
            _ => {
                eprintln!("Error: {err}");
            }
        },
    }

    Ok(())
}

Dynamic handlers

Some features such as the execute, reload, and print actions, and even the previewer do not have their behavior defined directly in the render loop.

Rather, they are attached as handlers to the Matchmaker, which are triggered by certain events and interrupts generated by the loop.

Some actions can generate these triggers, as well usually performing a minimal amount of other logic.

For example, the Preview(bat {}) command generates a PreviewChanged event, and leaves the string contents as a payload in the render state. This render state is exposed to the handler, and is used to spawn the command which is then displayed to preview.

In this way, very little of the Preview action's behavior is fixed. The Execute action is another example: it simply leaves the tui before raising the execute interrupt, then re-enters before the next render -- the handler associated to the interrupt is what spawns the process in the main app.

Consequently, action handling can in some cases be customized with minimal changes. For more extensive customization however, the set of actions can be extended with a type implementing ActionExt.

For more information, check out the examples and Architecture.md

See also

Commit count: 33

cargo fmt