A lightweight fuzzy finder written in MoonBit
npm install @paveg/mzfA lightweight fuzzy finder written in MoonBit with fzf-compatible options.
- Fast fuzzy matching with smart case sensitivity
- Scoring algorithm based on fzf/skim
- TUI interface with keyboard navigation
- Multi-select support (-m, --multi)
- Field-based matching (-n, --nth, -d, --delimiter)
- Exact match mode (-e, --exact)
- ANSI color support (--ansi)
- History support (--history)
- Preview pane support (--preview)
- Stdin pipe support (both native and JS builds)
- Extended search mode (-x, --extended)
- Shell integration (Bash, Zsh, Fish)
- Lightweight: ~636KB native binary, ~318KB JS
| Tool | Language | Binary Size | Features |
|------|----------|-------------|----------|
| fzf | Go | ~3.5MB | Full-featured, preview, multi-select |
| skim | Rust | ~3.9MB | fzf-compatible, async |
| peco | Go | ~4.7MB | Simple, customizable |
| mzf | MoonBit | ~637KB | fzf-compatible, preview, shell integration, lightweight |
mzf is ~6x smaller than alternatives while providing fzf-compatible options.
``bash`
npm install -g @paveg/mzf
Requires MoonBit toolchain.
`bash`
git clone https://github.com/paveg/mzf.git
cd mzf
moon install
make
make install # installs to ~/.local/bin/mzf
`bashPipe input to mzf
find . -type f | mzf
Key Bindings
| Key | Action |
|-----|--------|
|
Enter | Select current item |
| Tab | Toggle mark (multi-select, requires -m) |
| Esc / Ctrl+C | Cancel |
| Up / Down | Move selection / History navigation |
| Page Up / Page Down | Move selection by page |
| Ctrl+P / Ctrl+N | History prev/next (with --history) |
| Ctrl+U | Clear query |
| Backspace | Delete character |Options
$3
| Option | Description |
|--------|-------------|
|
-x, --extended | Extended search mode (see below) |
| -q, --query | Start with the given query |
| -e, --exact | Exact-match mode (substring) |
| -i, --ignore-case | Force case-insensitive matching |
| -n, --nth | Match only in specified fields |
| -d, --delimiter | Field delimiter |#### Extended Search Mode (
-x)| Token | Match type | Description |
|-------|-----------|-------------|
|
term | fuzzy | Default fuzzy match |
| ^term | prefix | Starts with term |
| term$ | suffix | Ends with term |
| 'term | exact | Exact substring match |
| !term | inverse | Exclude items matching term |
| !^term | inverse prefix | Exclude items starting with term |
| term1 term2 | AND | Both terms must match |
| term1 \| term2 | OR | Either term matches |$3
| Option | Description |
|--------|-------------|
|
--reverse | Display from top to bottom |
| --height | Maximum height (default: full screen) |
| --prompt | Input prompt (default: "> ") |
| --pointer | Pointer to current line (default: "> ") |
| --marker | Multi-select marker (default: "*") |
| --header | Header string to display |
| --header-lines | First N lines of input as header |
| --with-nth | Field index for display transformation |
| --ansi | Enable ANSI color processing |
| --border