#fuzzy-finder #command-line-tool #makefile #execute-command #preview #window #target

app fzf-make

A command line tool that executes commands using fuzzy finder with preview window for make, pnpm

38 breaking releases

new 0.46.0 Dec 12, 2024
0.44.0 Dec 10, 2024
0.38.0 Nov 24, 2024
0.35.0 Jun 18, 2024
0.10.0 Nov 30, 2023

#51 in Command line utilities

Download history 17/week @ 2024-09-12 20/week @ 2024-09-19 7/week @ 2024-09-26 2/week @ 2024-10-03 110/week @ 2024-10-24 28/week @ 2024-10-31 5/week @ 2024-11-07 3/week @ 2024-11-14 119/week @ 2024-11-21 348/week @ 2024-11-28 341/week @ 2024-12-05

811 downloads per month

MIT license

170KB
4K SLoC

fzf-make is a command line tool that executes commands using fuzzy finder with preview window. Currently supporting make, pnpm, yarn.

License:MIT Latest Release crates.io Crates.io Total Downloads

[English] [Deutsch] [Français]

🛠️ Features

  • Select and execute a make target or (pnpm | yarn) scripts using fuzzy-finder with a preview window by running fzf-make!
  • Execute the last executed command(By running fzf-make --repeat.)
  • Command history
  • Support make, pnpm, yarn. Scheduled to be developed: npm.
  • [make] Support include directive
  • [pnpm] Support workspace(collect scripts all of package.json in the directory where fzf-make is launched.)
  • [yarn] Support workspace(collect all scripts which is defined in workspaces field in root package.json.)
  • (Scheduled to be developed) Support config file

👓 Prerequisites

  • (If you install fzf-make via a package manager other than Homebrew) bat
    • In the future, we intend to make it work with cat as well, but currently it only works with bat.

📦 Installation

macOS

Homebrew

You don't need to install bat because fzf-make will install it automatically via Homebrew.

# install
brew install kyu08/tap/fzf-make
# update 
brew update && brew upgrade fzf-make

Arch Linux

fzf-make can be installed from the AUR using an AUR helper. For example:

paru -S fzf-make

NixOS / Nix (package manager)

fzf-make can be run from the repository (latest version)

nix run github:kyu08/fzf-make

Or from the nixpkgs (channel >= 23.05)

nix run nixpkgs#fzf-make

Note You may need to enable experimental feature. In that case, execute the following command to enable them echo "experimental-features = nix-command flakes" | tee ~/.config/nix/nix.conf

OS-independent method

Cargo

cargo install --locked fzf-make

💡 Usage

Run target using fuzzy finder

  1. Execute fzf-make in the directory you want to run make target, or (pnpm | yarn) scripts.
  2. Select command you want to execute. If you type some characters, the list will be filtered. demo demo

Run target from history

  1. Execute fzf-make in the directory you want to run make target, or (pnpm | yarn) scripts.
  2. Press Tab to move to the history pane.
  3. Select command you want to execute. demo

How fzf-make judges which command runner can be used

make

Whether makefile(file name should be one of GNUmakefile, makefile, Makefile) is in the current directory.

pnpm

Whether package.json and pnpm-lock.yaml are in the current directory.

yarn

Whether package.json and yarn.lock are in the current directory.

Commands Supported

Command Description
fzf-make Launch fzf-make
fzf-make --repeat / fzf-make -r / fzf-make repeat Execute last executed target
fzf-make --history / fzf-make -h / fzf-make history Launch fzf-make with the history pane focused
fzf-make --help / fzf-make help Show help
fzf-make --version / fzf-make -v / fzf-make version Show version

💻 Development

  1. Clone this repository
  2. Change the codes
  3. Run make run

To execute test, run make test(needs nextest).

nix

Or you can use nix to create a development shell with the project dependencies.

Within the repo root, execute the following command:

nix develop

👥 Contribution

  • Contributions are welcome!
  • If you have a Feature request, please create an issue first.
  • If you have added fzf-make to some package manager, please let me know. (or please send a PR to add how to install via the package manager in the README.md)
  • If you have any questions, feel free to create an issue and ask.

🗒 Related Article(s)

Dependencies

~12–23MB
~348K SLoC