Intro

Github Copilot is an awesome tool, that I use in JetBrains Rider and VS Code and recently I found out, that Copilot can be used in CLI aswell. Let me show you how to set it up.

file

Installation

  1. Install github cli

This depends on what packaging software you use. For full list of choices follow this link https://github.com/cli/cli#windows. I’m gonna use chocolatey.

  1. Authenticate

Run following, to authenticate with your GitHub account.

  1. Install Copilot

  1. You are done

Now you can run

Bonus

Running previous suggest command is in my opinion not very convenient, because it’s long and you need to first choose what kind of command you are asking about.

file

To get around that, we can use -t argument and we can specify shell so the full command will look as follows

This gives you the anwser right away, but it’s still too long, so let’s fix that.

Open your powershell profile – type $PROFILE, hit ENTER and you will get the profile path, then open it in your prefered editor.

Alteratively, if you use VS Code, just type: code $PROFILE, this opens your powershell profile in VS Code right away.

Once you opened the powershell profile, paste in following code:

Save the profile, restart your terminal and voila, you can use ?? or ps? commands. For example ps? list all ps1 files gives you the anwser

Enjoy 👍

Links

Last modified: December 6, 2023
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments