@antfu/ni alternative written in fish shell using abbr feature!
- Automatically detects the package manager (npm, yarn, pnpm, bun, deno) in the current directory.
- fish shell
- fzf (or your favorite fuzzy finder such as peco, skim, etc.)
- Install with fisher
fisher install ryoppippi/na.fish
- Configure your favorite abbrv ex:
abbr -a n -f _na
You can customize the following options in your config.fish file:
# Set the fuzzy finder command to use (default: fzf)
set -g NA_FUZZYFINDER sk
# Set the fuzzy finder options
set -g NA_FUZZYFINDER_OPTIONS
# Set your favorite package manager list. You can customize the order. (default: npm pnpm bun yarn deno)
set -g NA_PACKAGE_MANAGER_LIST bun deno pnpm yarn npm
Set options like this:
set -g NA_FUZZYFINDER fzf
set -g NA_FUZZYFINDER_OPTIONS --bind 'one:accept' --query '^'
These options are:
--bind 'one:accept'
: Automatically select the first item if there is only one item in the list.--query '^'
: Make query be matched from the beginning of the line, not fuzzy search.
Just type n
(or your favorite abbr key) and hit space key, then the appropriate node/deno package manager command will be expanded.
MIT