Following our public beta, we're excited to announce the general availability of GitHub Copilot in the CLI! ๐
Bringing GitHub Copilot to your terminal, GitHub Copilot in the CLI assists with any task in the terminal:
ghcs
and ghce
aliases and executing commands for popular shells
Before GitHub Universe, we knew our community would need these two features from the Copilot for CLI technical preview, however your feedback in #2 and #5 confirmed it!
gh copilot alias
will generate aliases for Bash, PowerShell, or Zsh that use fewer keystrokes to jump into the gh copilot
experience:
ghcs
for gh copilot suggest
ghce
for gh copilot explain
gh copilot alias --help
Bash
echo 'eval "$(gh copilot alias -- bash)"' >> ~/.bashrc
PowerShell
$GH_COPILOT_PROFILE = Join-Path -Path $(Split-Path -Path $PROFILE -Parent) -ChildPath "gh-copilot.ps1" gh copilot alias -- pwsh | Out-File ( New-Item -Path $GH_COPILOT_PROFILE -Force ) echo ". $GH_COPILOT_PROFILE" >> $PROFILE
Zsh
echo 'eval "$(gh copilot alias -- zsh)"' >> ~/.zshrc
In addition to making you faster, the new ghcs
alias is the basis for the new Execute command
option to execute and preserve generated suggestions:
$ ghcs upgrade GitHub CLI on MacOS Welcome to GitHub Copilot in the CLI! version 1.0.0 (2024-03-18) I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve. For more information, see https://gh.io/gh-copilot-transparency Suggestion: brew upgrade gh ? Select an option [Use arrows to move, type to filter] > Copy command to clipboard Explain command Execute command Revise command Rate response Exit
Note
We are open to supporting additional popular shells with help from our community providing the same experience! ๐
Configuration forExecute command
confirmation prompt
GitHub Copilot in the CLI prompts for confirmation when executing commands. This safeguard will return you to the interactive loop if declined, focusing on safety by minimizing accidents.
$ ghcs upgrade GitHub CLI on MacOS Welcome to GitHub Copilot in the CLI! version 1.0.0 (2024-03-18) I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve. For more information, see https://gh.io/gh-copilot-transparency Suggestion: brew upgrade gh ? Select an option > Execute command ? Are you sure you want to execute the suggested command? [Use arrows to move, type to filter] > No Yes
However if you feel the trade off between safety and speed is important, gh copilot config
provides an option that can change the confirmation prompt default, allowing faster execution of commands by removing the need to select Yes
.
$ gh copilot config ? What would you like to configure? > Default value for confirming command execution ? Default when asked to confirm execution of a generated suggestion? [Use arrows to move, type to filter] > No YesCopy to clipboard exits immediately
With GitHub Copilot's goal of keeping you in the flow, the Copy to clipboard
option has been changed to exit immediately based on feedback from #2.
$ ghcs upgrade GitHub CLI on MacOS Welcome to GitHub Copilot in the CLI! version 1.0.0 (2024-03-18) I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve. For more information, see https://gh.io/gh-copilot-transparency Suggestion: brew upgrade gh ? Select an option > Copy command to clipboard Command copied to clipboard!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4