Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.

Commit 2788380

Browse files
committed
Update docs
1 parent ca1ec33 commit 2788380

File tree

1 file changed

+70
-3
lines changed

1 file changed

+70
-3
lines changed

README.md

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ For more information on what data is collected, used, and shared, see "[Privacy
88

99
## Quickstart
1010

11-
> **Note**
11+
> [!NOTE]
1212
> To use and install GitHub Copilot in the CLI, you must have an active [GitHub Copilot](https://github.com/features/copilot) subscription and have [GitHub CLI](https://cli.github.com/) installed.
1313
14-
1. Authenticate with OAuth token
14+
1. Authenticate with GitHub CLI OAuth app
1515
```shell
1616
gh auth login --web -h github.com
1717
```
@@ -30,14 +30,21 @@ For more information on what data is collected, used, and shared, see "[Privacy
3030

3131
## Usage
3232

33-
```
33+
```shell
3434
$ gh copilot --help
3535
Your AI command line copilot.
3636

3737
Usage:
3838
copilot [command]
3939

40+
Examples:
41+
42+
$ gh copilot suggest "Install git"
43+
$ gh copilot explain "traceroute github.com"
44+
45+
4046
Available Commands:
47+
alias Generate shell-specific aliases for convenience
4148
config Configure options
4249
explain Explain a command
4350
suggest Suggest a command
@@ -49,6 +56,66 @@ Flags:
4956
Use "copilot [command] --help" for more information about a command.
5057
```
5158

59+
## Set up optional helpers
60+
61+
**Is `gh copilot suggest ...` too many keystrokes? Do you want support for executing suggestions and keeping them in history?**
62+
63+
[`v1.0.0`](https://github.com/github/gh-copilot/releases/tag/v1.0.0) introduces `gh copilot alias`, which generates shell configuration for `ghcs` and `ghce` aliases that wrap `gh copilot suggest` and `gh copilot explain`. These aliases provide faster invocation and support executing suggested commands if applicable. Executed suggestions are added to your shell history for reuse later.
64+
65+
```shell
66+
$ ghcs print "Hello world"
67+
68+
Welcome to GitHub Copilot in the CLI!
69+
version 1.0.0 (2024-03-21)
70+
71+
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
72+
73+
Suggestion:
74+
75+
echo "Hello world"
76+
77+
? Select an option
78+
> Execute command
79+
80+
? Are you sure you want to execute the suggested command?
81+
> Yes
82+
83+
Hello world
84+
```
85+
86+
To setup these optional helpers, see below for setup instructions for supported shells:
87+
88+
- [bash](#bash)
89+
- [powershell](#powershell)
90+
- [zsh](#zsh)
91+
92+
For more information, run `gh copilot alias --help`.
93+
94+
For changing the execute command confirmation behavior, run `gh copilot config` to change `Default value for confirming command execution`.
95+
96+
### Bash
97+
98+
```bash
99+
echo 'eval "$(gh copilot alias -- bash)"' >> ~/.bashrc
100+
```
101+
102+
### PowerShell
103+
104+
> [!NOTE]
105+
> PowerShell users might need to update the file containing `gh-copilot` helpers after updating the extension.
106+
107+
```pwsh
108+
$GH_COPILOT_PROFILE = Join-Path -Path $(Split-Path -Path $PROFILE -Parent) -ChildPath "gh-copilot.ps1"
109+
gh copilot alias -- pwsh | Out-File ( New-Item -Path $GH_COPILOT_PROFILE -Force )
110+
echo ". $GH_COPILOT_PROFILE" >> $PROFILE
111+
```
112+
113+
### Zsh
114+
115+
```zsh
116+
echo 'eval "$(gh copilot alias -- zsh)"' >> ~/.zshrc
117+
```
118+
52119
## Metrics sent to GitHub
53120
54121
GitHub Copilot in the CLI sends certain metrics to our analytics system. We want you to understand what is being

0 commit comments

Comments
 (0)