Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stephlin/click-pwsh
A click extension to support shell completion for PowerShell 7
https://github.com/stephlin/click-pwsh
click powershell pwsh python shell-completion
Last synced: 2 days ago
JSON representation
A click extension to support shell completion for PowerShell 7
- Host: GitHub
- URL: https://github.com/stephlin/click-pwsh
- Owner: StephLin
- License: bsd-3-clause
- Created: 2022-12-04T12:51:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-12T14:44:53.000Z (3 days ago)
- Last Synced: 2025-01-12T15:35:22.408Z (3 days ago)
- Topics: click, powershell, pwsh, python, shell-completion
- Language: Python
- Homepage: https://pypi.org/project/click-pwsh
- Size: 13.7 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `PS>` click-pwsh
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/click-pwsh)](https://pypi.org/project/click-pwsh/) [![PyPI version](https://badge.fury.io/py/click-pwsh.svg)](https://badge.fury.io/py/click-pwsh)
A [click](https://github.com/pallets/click) extension to support shell completion for **[PowerShell 7](https://github.com/PowerShell/PowerShell)**.
This extension is written based on click **8.x** (i.e., the rewritten click's completion system). Be aware of your click version before using it.
Hope it can provide smooth experiences for Windows users. d(`・∀・)b
## Installation
You can get the package from PyPI:
```bash
PS> pip install click-pwsh
```## Quickstart
Add the following code at the top of your script:
```python
from click_pwsh import support_pwsh_shell_completion
support_pwsh_shell_completion()
```And run the following command to install the shell completion:
```bash
PS> python -m click_pwsh install foo-bar
Complete.
```where `foo-bar` is your command name.
Then ... all done. Re-open PowerShell 7 and enjoy the shell completion!
## Update Shell Completion Scripts
If you upgrade click-pwsh, you can use the following command to update your shell completion scripts:
```bash
PS> python -m click_pwsh update foo-bar
Complete.
```where `foo-bar` is your command name whose shell completion scripts have already installed before.