Learn how to configure settings and set up aliases for Copilot in the CLI.
Setting up aliasesYou can create aliases for Copilot in the CLI to reduce keystrokes, and to allow Copilot in the CLI to execute commands on your behalf.
To allow Copilot in the CLI to execute commands, you must run the following commands to create the aliases (as opposed to creating an alias like you would for another shell command).
After executing the following commands to create the aliases, you can run ghcs
and ghce
instead of gh copilot suggest
and gh copilot explain
.
echo 'eval "$(gh copilot alias -- bash)"' >> ~/.bashrc
echo 'eval "$(gh copilot alias -- bash)"' >> ~/.bashrc
PowerShell Shell
$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
$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 Shell
echo 'eval "$(gh copilot alias -- zsh)"' >> ~/.zshrc
echo 'eval "$(gh copilot alias -- zsh)"' >> ~/.zshrc
Changing the default execution confirmation
When you use the ghcs
alias and you select Execute command, Copilot in the CLI will ask for confirmation before executing the command. You can change the default confirmation.
Execute the following command:
Shellgh copilot config
gh copilot config
Select Default value for confirming command execution.
Choose the desired default.
Unless you opt out, Copilot in the CLI will send a payload in the format below to the analytics system. This data helps improve the product. GitHub does not look at the data of specific individuals or at specific queries.
{
"platform": "darwin",
"architecture": "arm64",
"version": "0.3.0-beta",
"custom_event": "true",
"event_parent_command": "explain",
"event_name": "Explain",
"sha": "089a53215fc4383179869f7f6132ce9d6e58754a",
"thread_id": "e61d0d08-f6ba-465b-81cf-c30fd9127d70"
}
To opt in or out of data collection:
Execute the following command:
Shellgh copilot config
gh copilot config
Select Optional Usage Analytics.
Choose the desired default.
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