Use natural language to interact with PowerShell
Inspired by: Codex-CLI
Caution
Nothing is perfect! Read and verify AI-generated commands before running them. Treat them as if you found them on the internet—because they are commands from the internet. Do not run any command that you do not understand.
- Convert Natural Language to PowerShell Commands
- Get an Explanation
PS> # Get a list of the 5 most CPU-intensive processesPress Ctrl + Shift + Insert
PS> Get-Process | Sort-Object CPU -Descending | Select-Object -First 5 # Get a list of the 5 most CPU-intensive processesTip
NLPowerShell can leverage Get-Help or --help automatically to improve prediction accuracy
PS> git # list all tagsPress Ctrl + Ctrl + Insert
PS> git tag --list # list all tagsPS> Get-Command | Get-Random | Get-Help -FullPress Ctrl + Shift + Insert
PS> Get-Command | Get-Random | Get-Help -Full # Retrieve a random command and display its full help information.git clone https://github.com/Shresht7/NLPowerShell.gitor
gh repo clone Shresht7/NLPowerShellImport-Module -Name <Path\To\This\Module>Tip
If the module is placed in $PSModulePath (either manually, by installation, or via symlink), it can be imported with Import-Module -Name NLPowerShell.
Note
Adding this import to your $PROFILE will load the module automatically when PowerShell starts. You can also Initialize-NLPowerShell straight-away with your desired configuration.
Import-Module -Name NLPowerShell
Initialize-NLPowerShell -Ollama -Model "qwen2.5-coder" -Temperature 0.2Initialize-NLPowerShell -Ollama -Model "llama3.2" Initialize-NLPowerShell -OpenAI -Model "gpt-4" -API_KEY (Read-Host -AsSecureString -Prompt "OpenAI API Key") or you can read configuration from a file
Initialize-NLPowerShell -Path "Config.json"Initialize-NLPowerShell -KeyBind "Ctrl+Insert"Get-NLPowerShellConfigSet-NLPowerShellConfig -Provider Ollama -Model "llama3.2" -MaxTokens 64Export-NLPowerShellConfig -Path "Config.json"or
Export-NLPowerShellConfig -Path "config.xml"Import-NLPowerShellConfig -Path "config.xml"PS> # Get a list of markdown filesPress Ctrl + Shift + Insert
PS> Get-ChildItem -Path . -Filter "*.md" # Get a list of markdown filesPS> Get-DatePress Ctrl + Shift + Insert
PS> Get-Date # Get the current dateThis project is licensed under the MIT License.
