-
Authenticate with GitHub CLI OAuth app gh auth login --web -h github.com -
Install / upgrade extension gh extension install github/gh-copilot --force -
Suggest a command gh copilot suggest " Install and configure git lfs " -
Explain a command gh copilot explain ' git lfs migrate import --everything --include="*.gz,*.png,*.jar" '
$ gh copilot --help Your AI command line copilot. Usage: copilot [command] Examples: $ gh copilot suggest " Install git " $ gh copilot explain " traceroute github.com " Available Commands: alias Generate shell-specific aliases for convenience config Configure options explain Explain a command suggest Suggest a command Flags: -h, --help help for copilot --hostname string The GitHub host to use for authentication -v, --version version for copilot Use " copilot [command] --help " for more information about a command.
$ ghcs print " Hello world " Welcome to GitHub Copilot in the CLI ! version 1.0.0 (2024-03-21) 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:
echo "Hello world"
? Select an option
> Execute command
? Are you sure you want to execute the suggested command?
> Yes
Hello world
echo ' eval "$(gh copilot alias -- bash)" ' >> ~ /.bashrc
$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
echo ' eval "$(gh copilot alias -- zsh)" ' >> ~ /.zshrc
$ gh copilot config Welcome to GitHub Copilot CLI! version 0.3.0-beta (2023-10-31) 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. ? What would you like to configure? > Optional Usage Analytics ? Allow GitHub to collect optional usage data to help us improve? This data does not include your queries. [Use arrows to move, type to filter] > Yes No
{ "platform" : " darwin " , "architecture" : " arm64 " , "version" : " 1.1.0 " , "custom_event" : " true " , "event_parent_command" : " explain " , "event_name" : " Explain " , "sha" : " 089a53215fc4383179869f7f6132ce9d6e58754a " , "thread_id" : " e61d0d08-f6ba-465b-81cf-c30fd9127d70 " , "host" : " github.com " }