Giter Site home page Giter Site logo

diaazul / posh-predictive-text Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.46 MB

PowerShell predictive text for popular command line tools.

Home Page: https://posh-predictive-text.readthedocs.io

License: Apache License 2.0

C# 93.26% PowerShell 6.74%
command-line-tool csharp powershell-module powershell productivity-tool tab-expansion tab-expansion-handlers

posh-predictive-text's Introduction

Build status Documentation Status

Posh Predictive Text

Powershell predictive text logo

PowerShell module providing predictive text completions for common CLI tools.

Most people will be familiar with predictive text on mobile phones. Posh-predictive-text brings the same capability to the PowerShell command line interface for common CLI tools used within the software development and data science community.

Modern command line tools are highly configurable and have many parameters. It is difficult to remember them all. Posh Predictive Text improves productivity, not only by providing suggested completions, but also providing a pop-up list of suggestions with tooltips. These tooltips remove the need to break off from enter the command and search documentation for the correct parameter name.

In addition, Posh Predictive Text is also able to suggest a limited number of parameter arguments. For instance when using conda to activate an environment a list of environments is shown.

PoshPredictiveText provides suggested completions in the following situations:

  • When a partial argument is entered and the tab key is pressed. Successive suggestion appear each time the tab key is pressed.
  • Pressing ctrl + space displays a popup list of options with tooltips.
  • If PSReadLine options -PredictionSource is set to use the plugin and -PredictionViewStyle is set to ListView then suggestions will appear below the command line.
Demonstration.mp4

Supported Command Line Tools

Predictive text is available for the following commands line tools.

  • conda

If a tools is not supported then please consider helping by developing the syntax tree file needed to support it. Further information is available in the developer documentation.

Sponsorship

We all love open-source software. It's the freedom to use it and adapt it as you like. Its the no cost option. However, without funding open-source projects die. If you find this software useful then consider sponsoring the developers. It doesn't have to be a lot. The cost of a cup of coffee will do. Little contributions help and it is all very much appreciated.

GitHub Sponsors:

Please use the button at the top of the page to contribute via GitHub sponsors.

Ko-fi:

ko-fi

Installing / Getting started

PoshPredictiveText requires PowerShell version 7.2 or greater, and PSReadLine version 2.6 or greater.

You can check the version of PowerShell using the following command.

$PSVersionTable.PSVersion

The latest version of PowerShell is available on Github.

You can check the version of PSReadLine using the following command.

Get-Module PSReadLine | Format-List

Version 2.2.6 is pre-release and to install it the AllowPreRelease and -force options are required.

Install-Module PSReadLine -AllowPrerelease -Force

Install PoshPredictiveText from the PowerShell Gallery. This will download the module to the local user account. You may be asked for permission if you have not already set PowerShell gallery as trusted source.

Install-Module -name PoshPredictiveText

Add the following commands to the PowerShell profile. To locate the PowerShell profile open a command prompt and type $PROFILE.

Set-PredictiveTextOption -RemoveCondaTabExpansion
Install-PredictiveText

The first command removes tab-expansion that is already installed by conda, and which prevents Posh Predictive Text from providing completions. The second command installs Posh Predictive Text.

Completions will appear when a partial argument is entered and the tab key is pressed. A longer list of options with tooltips is available by pressing ctrl-space.

It is recommended to add the following PSReadLine options in the PowerShell profile so that suggestions appear below the command line as command arguments are entered.

Set-PSReadLineOption -PredictionSource HistoryAndPlugin -PredictionViewStyle ListView

Contributing

Contributions to the project are welcome. No developer is an island, there is never enough time to do everything and there is always another way to do things which may be better.

If you have a problem then raise an issue on the project issue tracker. If you have a suggested code improvement then submit a pull request.

If you wish to add support for another command line tool then read the developer documentation on the project web site. This will explain how the syntax tree files are developed, processed and integrated into the tool.

Links

Licensing

The code in this project is licensed under the Apache-2.0 license.

The name Posh Predictive Text and associated trade marks are the property of Tanzo Creative Ltd.

posh-predictive-text's People

Contributors

diaazul avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.