简体中文 | English | Powershell Gallery | Github | Gitee
Star ⭐️ or Donate 💰 if you like it!
[!Tip]
- PowerShell(pwsh): A cross-platform PowerShell (Core). Start it by running
pwsh/pwsh.exe.- Windows PowerShell: A PowerShell (Desktop) which is built-in on Windows system. Start it by running
powershell/powershell.exe.- They can both use
PSCompletions, but PowerShell(pwsh) is more recommended.
A completion manager for a better and simpler tab-completion experience in PowerShell.
[!Tip]
- If it cannot be displayed here, you can check it on the official website.
- Click to view the videos on Bilibili.

See the Changelog for details.
See the FAQ.
See the Contribution Guide for details.
Install the module.
Install-Module PSCompletions -Scope CurrentUser
Install-PSResource PSCompletions -Scope CurrentUser
Import the module.
Import-Module PSCompletions
Take git as an example.
psc add gitgit, press Space and Tab key to get command completion.Use PSCompletions as a better completion menu without psc add.
If there is an official completion for xxx, a similar command may be run:
xxx completion powershell | Out-String | Invoke-Expression
For more details, please refer to About menu enhance.
Use PSFzf as the completion menu, refer to Combine with PSFzf.
In addition to the built-in completion menu of PowerShell, PSCompletions module also provides a more powerful completion menu.
psc menu config enable_menu 1 (Default: 1)psc to view the related key bindings.It is only available in Windows, because PowerShell in Linux/MacOS does not implement the relevant methods.
All configurations of it, you can trigger completion by running psc menu, then learn about them by the completion tip.
1 means true and 0 means false. (It applies to all configurations of PSCompletions)psc menu config enable_enter_when_single 1psc menu config enable_menu_enhance 1 (Default: 1)Now, PSCompletions has two completion implementations.
enable_menu and enable_menu_enhance both set to 1.Set-PSReadLineKeyHandler -Key $PSCompletions.config.trigger_key -ScriptBlock { ... }.trigger_key is Tab.Set-PSReadLineKeyHandler -Key Tab -ScriptBlock { ... }.psc add.
cd/.\/..\/~\/…Get-*/Set-*/New-*/…psc menu config enable_menu_enhance 0.psc add.Optional Completions: some command completions that like -*, such as --global in git config --global.git as an example, if you want to enter git config user.name --global xxx, you should use --global completion first, and then use user.name, and then enter the name xxx.=, if there’s completion definition, you can directly press the Tab key to get the completions.git for example, when entering git add, pressing the Space and Tab keys, path completion will not be triggered, only completion provided by the module will be triggered.^(?:\.\.?|~)?(?:[/\\]).*../ or .\ and press Tab key to get path completion for the subdirectory or file.../ or ..\ and press Tab key to get path completion for the parent directory or file./ or \ and press Tab key to get path completion for the sibling directory.~/ / ../../ …git add ./ and then press Tab key to get the path completion.[!Tip]
- Due to changes in Windows Terminal, 😄🤔😎 cannot be displayed properly in the completion menu, so they will be replaced.
- Related issue: https://github.com/microsoft/terminal/issues/18242
- New symbols:
~,?,!
Special symbols after the completion item are used to let you know in advance if completions are available before you press the Tab key.
psc add.psc menu symbol <type> <symbol>psc menu symbol SpaceTab ""psc menu symbol OptionTab ""psc menu symbol WriteSpaceTab ""~,?,! : If there are multiple, you can choose the effect of one of them.
~ : It means that after you apply it, you can press Tab key to continue to get completions.? : It means that after you apply the option completion, you can press Tab key to continue to get current list of completion items.! : It means that after you apply the option completion, you should enter a string, then press Tab key to continue to get current list of completion items.
" or ' to wrap it. e.g. "test content"~, it means that there’s some preset completions, you can press Tab key to continue to get them without entering a string.The completion tip is only a helper and can be used as needed.
psc menu config enable_tip 0psc completion git enable_tip 0General structure of the completion tip: Usage + Description + Example
U: install, add [-g, -u] [options] <app>
This is a description of the command.
E: install xxx
add -g xxx
Example Analysis:
U:
installadd<app>
app is a simple summary of the parameters.-g -u
[options]: Some options.E:Global language: Default to the language of current system.
psc config language.psc config language zh-CN.Completion language: The language set for the specified completion.
psc completion git language en-US.Available language: In the completion config.json file, there is a language attribute whose value is a list of available languages.Completion language,use it. If not, use Global language.Available language.Available language. (It’s usually en-US)