{"id":13545136,"url":"https://github.com/kelleyma49/PSFzf","last_synced_at":"2025-04-02T15:30:58.253Z","repository":{"id":37470962,"uuid":"72041948","full_name":"kelleyma49/PSFzf","owner":"kelleyma49","description":"A PowerShell wrapper around the fuzzy finder fzf","archived":false,"fork":false,"pushed_at":"2024-11-17T02:19:00.000Z","size":3609,"stargazers_count":901,"open_issues_count":54,"forks_count":40,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T17:06:56.859Z","etag":null,"topics":["commandline","fzf","powershell","powershell-modules"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kelleyma49.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-26T20:32:15.000Z","updated_at":"2025-03-28T23:15:35.000Z","dependencies_parsed_at":"2024-01-11T04:32:01.377Z","dependency_job_id":"c1237a11-4a12-4c77-a653-d7a9f99925f0","html_url":"https://github.com/kelleyma49/PSFzf","commit_stats":{"total_commits":392,"total_committers":21,"mean_commits":"18.666666666666668","dds":"0.23979591836734693","last_synced_commit":"3f31db0367a4865378cc9f667dd3f679d2590c6f"},"previous_names":[],"tags_count":133,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelleyma49%2FPSFzf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelleyma49%2FPSFzf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelleyma49%2FPSFzf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelleyma49%2FPSFzf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kelleyma49","download_url":"https://codeload.github.com/kelleyma49/PSFzf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246841596,"owners_count":20842618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commandline","fzf","powershell","powershell-modules"],"created_at":"2024-08-01T11:00:58.093Z","updated_at":"2025-04-02T15:30:57.807Z","avatar_url":"https://github.com/kelleyma49.png","language":"PowerShell","funding_links":[],"categories":["PowerShell","🚀 Productivity","Commandline Productivity"],"sub_categories":[],"readme":"# PSFzf\n\n[![PowerShell Gallery Version](https://img.shields.io/powershellgallery/v/PSFzf.svg)](https://www.powershellgallery.com/packages/PSFzf)\n[![PowerShell Gallery Version](https://img.shields.io/powershellgallery/v/PSFzf?include_prereleases)](https://www.powershellgallery.com/packages/PSFzf)\n[![PowerShell Gallery Downloads](https://img.shields.io/powershellgallery/dt/PSFzf)](https://www.powershellgallery.com/packages/PSFzf)\n[![Build status](https://github.com/kelleyma49/PSFzf/workflows/CI/badge.svg)](https://github.com/kelleyma49/PSFzf/actions)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/kelleyma49/PSFzf/blob/master/LICENSE)\n\nPSFzf is a PowerShell module that wraps [fzf](https://github.com/junegunn/fzf), a fuzzy file finder for the command line.\n\n![keyboard shortcut demonstration](https://raw.github.com/kelleyma49/PSFzf/master/docs/PSFzfExample.gif)\n\n## Usage\n\nTo change to a user selected directory:\n\n```powershell\nGet-ChildItem . -Recurse -Attributes Directory | Invoke-Fzf | Set-Location\n```\n\nTo edit a file:\n\n```powershell\nGet-ChildItem . -Recurse -Attributes !Directory | Invoke-Fzf | % { notepad $_ }\n```\n\nFor day-to-day usage, see the [helper functions included with this module](https://github.com/kelleyma49/PSFzf#helper-functions).\n\n## PSReadline Integration\n\n### Select Current Provider Path (default chord: \u003ckbd\u003eCtrl+t\u003c/kbd\u003e)\n\nPress \u003ckbd\u003eCtrl+t\u003c/kbd\u003e to start PSFzf to select provider paths.  PSFzf will parse the current token and use that as the starting path to search from.  If current token is empty, or the token isn't a valid path, PSFzf will search below the current working directory.\n\nMultiple items can be selected.  If more than one is selected by the user, the results are returned as a comma separated list.  Results are properly quoted if they contain whitespace.\n\n### Reverse Search Through PSReadline History (default chord: \u003ckbd\u003eCtrl+r\u003c/kbd\u003e)\n\nPress \u003ckbd\u003eCtrl+r\u003c/kbd\u003e to start PSFzf to select a command in the command history saved by PSReadline.  PSFzf will insert the command into the current line, but it will not execute the command.\n\nPSFzf does not override \u003ckbd\u003eCtrl+r\u003c/kbd\u003e by default.  To confirm that you want to override PSReadline's chord binding, use the [`Set-PsFzfOption`](docs/Set-PsFzfOption.md) command:\n\n```powershell\n# replace 'Ctrl+t' and 'Ctrl+r' with your preferred bindings:\nSet-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'\n```\n\n### Set-Location Based on Selected Directory (default chord: \u003ckbd\u003eAlt+c\u003c/kbd\u003e)\n\nPress \u003ckbd\u003eAlt+c\u003c/kbd\u003e to start PSFzf to select a directory.  By default, `Set-Location` will be called with the selected directory. You can override the default command with the following code in our `$PROFILE`:\n\n```powershell\n# example command - use $Location with a different command:\n$commandOverride = [ScriptBlock]{ param($Location) Write-Host $Location }\n# pass your override to PSFzf:\nSet-PsFzfOption -AltCCommand $commandOverride\n```\n\n### Search Through Command Line Arguments in PSReadline History (default chord: \u003ckbd\u003eAlt+a\u003c/kbd\u003e)\n\nPress \u003ckbd\u003eAlt+a\u003c/kbd\u003e to start PSFzf to select command line arguments used in PSReadline history.  The picked argument will be inserted in the current line.  The line that would result from the selection is shown in the preview window.\n\n## Tab Expansion\n\nPSFzf can replace the standard tab completion:\n\n```powershell\nSet-PSReadLineKeyHandler -Key Tab -ScriptBlock { Invoke-FzfTabCompletion }\n```\n\nTo activate continuous completion, press the directory separator character to complete the current selection and start tab completion for the next part of the container path.\n\nPSFzf supports specialized tab expansion with a small set of commands. After typing the default trigger command, which defaults to \"`**`\", and press \u003ckbd\u003eTab\u003c/kbd\u003e, PsFzf tab expansion will provide selectable list of options.\n\nThe following commands are supported:\n\n| Command | Notes |\n|---------|-------|\n| `git`   | Uses [`posh-git`](https://github.com/dahlbyk/posh-git) for providing tab completion options. Requires at least version 1.0.0 Beta 4.\n| `Get-Service`, `Start-Service`, `Stop-Service` | Allows the user to select between the installed services.\n| `Get-Process`, `Start-Process` | Allows the user to select between running processes.\n\nTo override the trigger command, set `FZF_COMPLETION_TRIGGER` to your preferred trigger sequence.\n\nUse the following command to enable tab expansion:\n\n```powershell\nSet-PsFzfOption -TabExpansion\n```\n\n## Using within a Pipeline\n\n`Invoke-Fzf` works with input from a pipeline. You can use it in the middle of a pipeline, or as part of an expression.\n\n```powershell\nSet-Location (Get-ChildItem . -Recurse | ? { $_.PSIsContainer } | Invoke-Fzf) # This works as of version 2.2.8\nGet-ChildItem . -Recurse | ? { $_.PSIsContainer } | Invoke-Fzf | Set-Location\n```\n\n## Overriding Behavior\n\nPsFzf supports overriding behavior by setting these fzf environment variables:\n| Env Var Name                 | Description                                                                                                                  |\n|------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| `_PSFZF_FZF_DEFAULT_OPTS`    | If this environment variable is set, then `FZF_DEFAULT_OPTS` is temporarily set with the contents. This allows the user to have different default options for PSFZF and fzf.\n| `FZF_DEFAULT_COMMAND`        | The command specified in this environment variable will override the default command when PSFZF detects that the current location is a file system provider. |\n| `FZF_CTRL_T_COMMAND`         | The command specified in this environment variable will be used when \u003ckbd\u003eCtrl+t\u003c/kbd\u003e is pressed by the user.                |\n| `FZF_ALT_C_COMMAND`          | The command specified in this environment variable will be used when \u003ckbd\u003eAlt+c\u003c/kbd\u003e is pressed by the user.                 |\n| `PSFZF_EDITOR_OPTIONS`       | Contains options passed to the editor application used in the `Invoke-FuzzyEdit()` function                                   |\n\n## Helper Functions\n\nIn addition to its core function [Invoke-Fzf](docs/Invoke-Fzf.md), PSFzf includes a set of useful functions and aliases. The aliases are not installed by default. To enable aliases, use [`Set-PSFzfOption`](docs/Set-PsFzfOption.md)'s  `-EnableAlias`* options.\n\n| Function                                                             | Alias      | Description\n| ---------------------------------------------------------------------| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [`Invoke-FuzzyEdit`](docs/Invoke-FuzzyEdit.md)                       | `fe`       | Starts an editor for the selected files in the fuzzy finder.\n| [`Invoke-FuzzyFasd`](docs/Invoke-FuzzyFasd.md)                       | `ff`       | Starts fzf with input from the files saved in [fasd](https://github.com/clvv/fasd)(non-Windows) or [fasdr](https://github.com/kelleyma49/fasdr) (Windows) and sets the current location.\n| [`Invoke-FuzzyZLocation`](docs/Invoke-FuzzyZLocation.md)             | `fz`       | Starts fzf with input from the history of [ZLocation](https://github.com/vors/ZLocation) and sets the current location.\n| [`Invoke-FuzzyGitStatus`](docs/Invoke-FuzzyGitStatus.md)             | `fgs`      | Starts fzf with input from output of the `git status` function.\n| [`Invoke-FuzzyHistory`](docs/Invoke-FuzzyHistory.md)                 | `fh`       | Rerun a previous command from history based on the user's selection in fzf.\n| [`Invoke-FuzzyKillProcess`](docs/Invoke-FuzzyKillProcess.md)         | `fkill`    | Runs `Stop-Process` on processes selected by the user in fzf.\n| [`Invoke-FuzzySetLocation`](docs/Invoke-FuzzySetLocation.md)         | `fd`       | Sets the current location from the user's selection in fzf.\n| [`Invoke-FuzzyScoop`](docs/Invoke-FuzzyScoop.md)                     | `fs`       | Starts fzf on [Scoop](https://scoop.sh) applications list.\n| [`Invoke-PsFzfRipgrep`](docs/Invoke-PsFzfRipgrep.md)                 | N/A        | Uses Ripgrep and Fzf to interactively search files.\n| [`Set-LocationFuzzyEverything`](docs/Set-LocationFuzzyEverything.md) | `cde`      | Sets the current location based on the [Everything](https://www.voidtools.com/) database.\n\n## Prerequisites\n\nFollow the [installation instructions for fzf](https://github.com/junegunn/fzf#installation) before installing PSFzf.   PSFzf will run `Get-Command` to find `fzf` in your path.\n\n### Windows\n\nThe latest version of `fzf` is available via [Chocolatey](https://chocolatey.org/packages/fzf), or you can download the `fzf` binary and place it in your path.  Run `Get-Command fzf*.exe` to verify that PowerShell can find the executable.\n\nPSFzf has been tested under PowerShell 5.0, 6.0, and 7.0.\n\n### MacOS\n\nUse Homebrew or download the binary and place it in your path.  Run `Get-Command fzf*` to verify that PowerShell can find the executable.\n\nPSFzf has been tested under PowerShell 6.0 and 7.0.\n\n### Linux\n\nPSFzf has been tested under PowerShell 6.0 and 7.0 in the Windows Subsystem for Linux.\n\n## Installation\n\nPSFzf is available on the [PowerShell Gallery](https://www.powershellgallery.com/packages/PSFzf) and [Scoop](https://github.com/ScoopInstaller/Extras/blob/master/bucket/psfzf.json).  PSReadline should be imported before PSFzf as PSFzf registers PSReadline key handlers listed in the [PSReadline integration section](https://github.com/kelleyma49/PSFzf#psreadline-integration).\n\n## Helper Function Requirements\n\n* [`Invoke-FuzzyFasd`](docs/Invoke-FuzzyFasd.md) requires [Fasdr](https://github.com/kelleyma49/fasdr) to be previously installed under Windows.  Other platforms require [Fasd](https://github.com/clvv/fasd) to be installed.\n* [`Invoke-FuzzyZLocation`](docs/Invoke-FuzzyZLocation.md) requires [ZLocation](https://github.com/vors/ZLocation) and works only under Windows.\n* [`Set-LocationFuzzyEverything`](docs/Set-LocationFuzzyEverything.md) works only under Windows and requires [PSEverything](https://github.com/powercode/PSEverything) to be previously installed.\n* [`Invoke-FuzzyScoop`](docs/Invoke-FuzzyScoop.md) works only under Windows and requires [Scoop](https://scoop.sh) to be previously installed.\n* [`Invoke-FuzzyGitStatus`](docs/Invoke-FuzzyGitStatus.md) requires [git](https://git-scm.com/) to be installed.\n* [`Invoke-PsFzfRipgrep`](docs/Invoke-PsFzfRipgrep.md) requires [ripgrep](https://github.com/BurntSushi/ripgrep) and [bat](https://github.com/sharkdp/bat) to be installed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkelleyma49%2FPSFzf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkelleyma49%2FPSFzf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkelleyma49%2FPSFzf/lists"}