github / gh-copilot

Ask for assistance right in your terminal.

Home Page:https://docs.github.com/en/copilot/github-copilot-in-the-cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEAT]: PowerShell support

ievsantillan opened this issue · comments

Describe the need

Please ensure gh-copilot model is trained on PowerShell

Version

version 1.0.0 (2024-03-18)

Relevant terminal output

gh copilot explain 'function test {"hello world"}'

The command you provided is not a valid shell command.

Using the latest release it does respond correctly now.
gh copilot explain 'function Hi { "hello world" } '

Results in:

• This command defines a function called Hi that prints the string "hello world".
• The function definition syntax in shell scripting is function_name() { command; }.
• In this case, the Hi function is defined and its body contains the command "hello world", which is a string.
• The command itself does not have any functionality beyond printing the string.

@rlove - I seem to get a diff response each run, still thinks it's not valid, though
2024-03-21 13_38_23-● hello world ps1 - hello-world - Visual Studio Code  Administrator

2024-03-21 13_39_53-● hello world ps1 - hello-world - Visual Studio Code  Administrator

Yeah, it could be improved if the Shell that you are running could be part of the prompt to the Co-Pilot Engine. It would likely work better. I typically add "powershell" some place in my prompt and it often give exactly what I am looking for.

@ievsantillan @rlove : thank you for opening this issue! ❤

GitHub Copilot in the CLI does not use a custom trained model significantly different than other GitHub Copilot capabilities. The primary difference is whether and how context is inferred from your use case. However, GitHub Copilot in the CLI does not currently gather or infer any context from your local workstation or anything beyond what you type including:

  • what operating system you are running on
  • what shell you are using
  • where you are within the operating system directory structure when you invoke gh-copilot
  • what environment variables are in scope of your terminal
  • what executables can be found on your path
  • etc

So, I think we're touching on #8 which likely differs between gh copilot suggest and gh copilot explain. Since we've start conversation there about client-side ways we can improve, I'd like to move this conversation there for now. 🙇