You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 30, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+70-3Lines changed: 70 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,10 @@ For more information on what data is collected, used, and shared, see "[Privacy
8
8
9
9
## Quickstart
10
10
11
-
> **Note**
11
+
> [!NOTE]
12
12
> 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.
13
13
14
-
1. Authenticate with OAuth token
14
+
1. Authenticate with GitHub CLI OAuth app
15
15
```shell
16
16
gh auth login --web -h github.com
17
17
```
@@ -30,14 +30,21 @@ For more information on what data is collected, used, and shared, see "[Privacy
30
30
31
31
## Usage
32
32
33
-
```
33
+
```shell
34
34
$ gh copilot --help
35
35
Your AI command line copilot.
36
36
37
37
Usage:
38
38
copilot [command]
39
39
40
+
Examples:
41
+
42
+
$ gh copilot suggest "Install git"
43
+
$ gh copilot explain "traceroute github.com"
44
+
45
+
40
46
Available Commands:
47
+
alias Generate shell-specific aliases for convenience
41
48
config Configure options
42
49
explain Explain a command
43
50
suggest Suggest a command
@@ -49,6 +56,66 @@ Flags:
49
56
Use "copilot [command] --help"for more information about a command.
50
57
```
51
58
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.
0 commit comments