Skip to content

An AI helper for creating CLI commands in Powershell

License

Notifications You must be signed in to change notification settings

Kamek437/please-pwsh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Please CLI for PowerShell Core

An AI helper script to create PowerShell commands. It is a copy of Please CLI.

The initial approach to ChatGPT please convert the bash script to pwsh did not work. So its a rewrite that still contains trace amounts of AI.

Usage

Same as Please CLI, it translates natural language into PowerShell commands with the help of GPT:

Please "Get all files in the current directory that are larger than 1 MB"

🔣 Command:
   Get-ChildItem -Path . -File | Where-Object { $_.Length -gt 1MB }
❓ What should I do?
[A] Abort  [C] Copy  [I] Invoke  [?] Help (default is "A"):

It can also explain commands:

Please -explain "Get-ChildItem -Path . -File | Where-Object { $_.Length -gt 1MB }"
☝ The command lists all the files in the current directory with a file size greater than 1MB.

🔣 Command:
   Get-ChildItem -Path . -File | Where-Object { .Length -gt 1MB }
❓ What should I do?
[A] Abort  [C] Copy  [I] Invoke  [?] Help (default is "A"):

Help

For help and parameter explanation run Get-Help Please.

Prerequisites

You need an OpenAI API key and access to GPT 3.5 Turbo.

Installation

From the PowerShell Gallery with

Install-Module -Name PleasePwsh

Set the OpenAI API key as environment variable.

  • Open PowerShell profile: Code $PROFILE
  • Add a line with your API key: $ENV:OPENAI_API_KEY = <YOUR_API_KEY>

About

An AI helper for creating CLI commands in Powershell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%