From 8fc6277e04e4861fd5b6d4d0e9793f2a073c2df0 Mon Sep 17 00:00:00 2001 From: Adam Hellberg Date: Thu, 16 Nov 2023 16:31:21 +0100 Subject: [PATCH] [pwsh] Add some PS aliases for GitHub copilot CLI --- powershell/profile.ps1 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/powershell/profile.ps1 b/powershell/profile.ps1 index 5af04e9..550e972 100644 --- a/powershell/profile.ps1 +++ b/powershell/profile.ps1 @@ -31,6 +31,30 @@ Set-Alias -Name g -Value git Set-Alias -Name vi -Value nvim Set-Alias -name vim -Value nvim +function Invoke-Copilot-Shell-Suggestion { + [Alias('?s')] + param([string] $query) + gh copilot suggest -t shell $query +} + +function Invoke-Copilot-Git-Suggestion { + [Alias('?g')] + param([string] $query) + gh copilot suggest -t git $query +} + +function Invoke-Copilot-GitHub-Cli-Suggestion { + [Alias('?gh')] + param([string] $query) + gh copilot suggest -t gh $query +} + +function Invoke-Copilot-Explain { + [Alias('?e')] + param([string] $query) + gh copilot explain $query +} + function Send-Key() { [CmdletBinding()] param ( -- 2.54.0