Home

Awesome

<div align="center"> <img src="https://raw.githubusercontent.com/kyu08/fzf-make/main/static/logo.png" />

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

<img src="https://raw.githubusercontent.com/kyu08/fzf-make/main/static/demo.gif" /> </div>

🛠️ Features

📦 Installation

macOS

Homebrew

# install
brew install fzf-make
# 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. <img width="752" alt="demo" src="https://raw.githubusercontent.com/kyu08/fzf-make/main/static/usage-main.png"> <img width="752" alt="demo" src="https://raw.githubusercontent.com/kyu08/fzf-make/main/static/usage-type-characters.png">

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. <img width="752" alt="demo" src="https://raw.githubusercontent.com/kyu08/fzf-make/main/static/usage-history.png">

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

CommandDescription
fzf-makeLaunch fzf-make
fzf-make --repeat / fzf-make -r / fzf-make repeatExecute last executed target
fzf-make --history / fzf-make -h / fzf-make historyLaunch fzf-make with the history pane focused
fzf-make --help / fzf-make helpShow help
fzf-make --version / fzf-make -v / fzf-make versionShow version

Example Aliases

To simplify the usage of fzf-make, you can define aliases in your shell configuration. Below is an example configuration that works for most shells (bash, zsh, fish, etc.):

alias fm='fzf-make'
alias fr='fzf-make repeat'
alias fh='fzf-make history'

💻 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

🗒 Related Article(s)