简体中文 | 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
Install-PSResource PSCompletions
Import the module.
Import-Module PSCompletions
[!Tip]
- If you use
. $Profile, please runpscto reload the module’s key bindings and data.- Refer to: https://pscompletions.abgox.com/faq/source-profile
Use the built-in completion library, like git.
psc add gitgit, press Space and Tab key to get command completion.Use official completion or other completion libraries.
If there is an official completion for xxx, a similar command may be run:
xxx completion powershell | Out-String | Invoke-Expression
Work with other completion libraries: argc-completions, Carapace
For more details, please refer to About menu enhance.
Use PSFzf as the completion menu, refer to Work 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 <Key> -ScriptBlock { ... }.
<Key> is the value of psc menu config trigger_key (default: 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:[!Tip]
Global language: Default to the language of current system.
- You can show it by running
psc config language.- You can change it by running
psc config language zh-CN.Completion language: The language set for the specified completion.
- e.g.
psc completion git language en-US.Available language: In the completionconfig.jsonfile, there is alanguageattribute whose value is a list of available languages.
Completion language,use it. If not, use Global language.Available language.
Available language: en-USSet-PSReadLineKeyHandler and Get-PSReadLineOption.