Skip to content

Use the old Copilot CLI syntax in the new gh version #86354

Answered by johanrosenkilde
NullDev asked this question in npm
Discussion options

You must be logged in to vote

You may add the following aliases into your .bashrc or .zshrc:

alias '??'='gh copilot suggest -t shell'
alias 'git?'='gh copilot suggest -t git'
alias 'explain'='gh copilot explain'

This allows calling e.g. ?? list all files like with the Next technical preview Copilot CLI. The difference is that you still "accept" by getting the command into your clipboard, at which point you should exit the cli and paste in the command in the shell.

In an upcoming version of the gh version, it will be born with a feature more closely matching the Next technical preview's in terms of aliases for quick execution.

Replies: 6 comments 10 replies

Comment options

You must be logged in to vote
3 replies
@NullDev
Comment options

@solrevdev
Comment options

@huyz
Comment options

Answer selected by NullDev
Comment options

You must be logged in to vote
1 reply
@rsmets
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@NullDev
Comment options

Comment options

You must be logged in to vote
5 replies
@solrevdev
Comment options

@stikoo
Comment options

@solrevdev
Comment options

@stikoo
Comment options

@solrevdev
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
npm
Labels
Copilot Code accurately and faster with your AI powered pair-programmer. Question npm Tagging to track for future npm category
8 participants