fpf-cli 1.5.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +3 -1
  2. package/fpf +33 -14
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -36,6 +36,8 @@ By default, `fpf` auto-detects your package manager.
36
36
 
37
37
  On macOS, default auto mode uses both `brew` and `bun` together.
38
38
 
39
+ On macOS with no query (`fpf`), startup uses installed package indexes for `brew` and `bun` for faster load; pass a query (`fpf ripgrep`) to search full catalogs.
40
+
39
41
  On Linux, default auto mode uses your distro manager plus installed cross-platform managers (`snap`, `flatpak`, `brew`, `npm`, `bun`).
40
42
 
41
43
  On Windows (Git Bash / MSYS / Cygwin), default auto mode uses installed Windows managers (`winget`, `choco`, `scoop`) plus `npm` and `bun`.
@@ -83,5 +85,5 @@ On Windows (Git Bash / MSYS / Cygwin), default auto mode uses installed Windows
83
85
  ## Notes
84
86
 
85
87
  - Requires: `bash` + `fzf`
86
- - If `fzf` is missing, `fpf` can prompt to auto-install it using a compatible detected manager.
88
+ - If `fzf` is missing, `fpf` auto-installs it using a compatible detected manager.
87
89
  - Root managers (`apt`, `dnf`, `pacman`, `zypper`, `emerge`, `snap`) use `sudo` when needed.
package/fpf CHANGED
@@ -212,9 +212,7 @@ ensure_fzf() {
212
212
  local candidate_labels
213
213
  candidate_labels="$(join_manager_labels "${candidates[@]-}")"
214
214
 
215
- if ! confirm_action "fzf is not installed. Install it now using ${candidate_labels}?"; then
216
- die "fzf is required"
217
- fi
215
+ log "fzf is missing. Auto-installing with: ${candidate_labels}"
218
216
 
219
217
  for manager in "${candidates[@]-}"; do
220
218
  log "Attempting fzf install with $(manager_label "${manager}")"
@@ -620,10 +618,13 @@ manager_search_entries() {
620
618
 
621
619
  if [[ -z "${effective_query}" ]]; then
622
620
  case "${manager}" in
623
- apt|dnf|pacman|zypper|emerge|winget|choco|scoop|snap|flatpak|npm|bun)
621
+ apt|dnf|pacman|zypper|emerge|choco|scoop|snap|flatpak)
624
622
  effective_query="a"
625
623
  ;;
626
- brew)
624
+ npm|bun)
625
+ effective_query="aa"
626
+ ;;
627
+ brew|winget)
627
628
  effective_query=""
628
629
  ;;
629
630
  esac
@@ -689,8 +690,13 @@ manager_search_entries() {
689
690
  '
690
691
  ;;
691
692
  brew)
692
- brew search "${effective_query}" 2>/dev/null |
693
- awk 'NF > 0 { print $1 "\t-" }'
693
+ if [[ -z "${query}" ]]; then
694
+ brew list --versions 2>/dev/null |
695
+ awk '{ print $1 "\tinstalled" }'
696
+ else
697
+ brew search "${effective_query}" 2>/dev/null |
698
+ awk 'NF > 0 { print $1 "\t-" }'
699
+ fi
694
700
  ;;
695
701
  winget)
696
702
  winget search "${effective_query}" --source winget --accept-source-agreements --disable-interactivity 2>/dev/null |
@@ -760,17 +766,30 @@ manager_search_entries() {
760
766
  fi
761
767
  ;;
762
768
  npm)
763
- npm search "${effective_query}" --searchlimit=500 --parseable 2>/dev/null |
769
+ npm search "${effective_query}" --searchlimit=200 --parseable 2>/dev/null |
764
770
  awk -F'\t' 'NF >= 2 { print $1 "\t" $2 }'
765
771
  ;;
766
772
  bun)
767
773
  {
768
- if bun search "${effective_query}" >/dev/null 2>&1; then
769
- bun search "${effective_query}" 2>/dev/null |
770
- awk 'NR > 1 && NF > 0 { name=$1; $1=""; sub(/^[[:space:]]+/, "", $0); if ($0 == "") $0="-"; print name "\t" $0 }'
771
- elif command_exists npm; then
772
- npm search "${effective_query}" --searchlimit=500 --parseable 2>/dev/null |
773
- awk -F'\t' 'NF >= 2 { print $1 "\t" $2 }'
774
+ if [[ -z "${query}" ]]; then
775
+ if bun pm ls --global >/dev/null 2>&1; then
776
+ bun pm ls --global 2>/dev/null |
777
+ awk 'NR > 1 && NF > 0 { print $1 "\tinstalled" }'
778
+ elif bun pm ls >/dev/null 2>&1; then
779
+ bun pm ls 2>/dev/null |
780
+ awk 'NR > 1 && NF > 0 { print $1 "\tinstalled" }'
781
+ elif command_exists npm; then
782
+ npm ls -g --depth=0 --parseable 2>/dev/null |
783
+ awk -F'/' 'NR > 1 { print $NF "\tglobal" }'
784
+ fi
785
+ else
786
+ if bun search "${effective_query}" >/dev/null 2>&1; then
787
+ bun search "${effective_query}" 2>/dev/null |
788
+ awk 'NR > 1 && NF > 0 { name=$1; $1=""; sub(/^[[:space:]]+/, "", $0); if ($0 == "") $0="-"; print name "\t" $0 }'
789
+ elif command_exists npm; then
790
+ npm search "${effective_query}" --searchlimit=200 --parseable 2>/dev/null |
791
+ awk -F'\t' 'NF >= 2 { print $1 "\t" $2 }'
792
+ fi
774
793
  fi
775
794
  } || true
776
795
  ;;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fpf-cli",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
4
4
  "description": "Cross-platform fuzzy package finder powered by fzf",
5
5
  "bin": {
6
6
  "fpf": "fpf"