1
00:00:07,003 --> 00:00:09,004
- [Instructor] Well, first of all, what is GitHub Copilot
2
00:00:09,004 --> 00:00:10,008
in the CLI?
3
00:00:10,008 --> 00:00:13,000
We’ve seen by investigating policy,
4
00:00:13,000 --> 00:00:14,001
it’s one of the places
5
00:00:14,001 --> 00:00:16,002
where we can interact with the service.
6
00:00:16,002 --> 00:00:19,002
In this case, it’s in your terminal. Isn’t that great?
7
00:00:19,002 --> 00:00:22,000
And that’s your terminal no matter which one you use,
8
00:00:22,000 --> 00:00:25,006
whether it’s a Mac terminal or Linux terminal
9
00:00:25,006 --> 00:00:27,005
or Windows terminal.
10
00:00:27,005 --> 00:00:31,000
As of this recording in spring 2025,
11
00:00:31,000 --> 00:00:34,001
the only supported language is English, unfortunately.
12
00:00:34,001 --> 00:00:36,006
The primary commands that this tool helps with
13
00:00:36,006 --> 00:00:40,001
are GitHub CLI commands, the GHCLI
14
00:00:40,001 --> 00:00:41,008
that I hope you’re familiar with.
15
00:00:41,008 --> 00:00:44,004
You have to be familiar with the GitHub CLI
16
00:00:44,004 --> 00:00:45,007
in order to be successful
17
00:00:45,007 --> 00:00:48,005
on not only the GitHub Copilot exam,
18
00:00:48,005 --> 00:00:52,001
but also the other four GitHub exams as well.
19
00:00:52,001 --> 00:00:55,002
The Git CLI, everybody’s favorite,
20
00:00:55,002 --> 00:00:59,004
and then Standard Shell like Bash or zShell.
21
00:00:59,004 --> 00:01:01,008
And I found that it’s okay with PowerShell,
22
00:01:01,008 --> 00:01:04,002
you can test different shells
23
00:01:04,002 --> 00:01:07,001
in scripting languages to see.
24
00:01:07,001 --> 00:01:10,006
There’s an option to choose a general CLI command.
25
00:01:10,006 --> 00:01:14,003
The 80% use cases here are to find the right command
26
00:01:14,003 --> 00:01:16,006
to perform a task in the moment.
27
00:01:16,006 --> 00:01:18,004
We’re not talking about you building
28
00:01:18,004 --> 00:01:21,001
an administrative script that’ll persist in a repo,
29
00:01:21,001 --> 00:01:24,000
we’re talking about when you’re live at a terminal.
30
00:01:24,000 --> 00:01:25,005
And also, just the opposite.
31
00:01:25,005 --> 00:01:28,004
You get an unfamiliar command from Stack Overflow.
32
00:01:28,004 --> 00:01:29,006
You take an extra moment,
33
00:01:29,006 --> 00:01:31,009
"Hey, can you explain what this means?"
34
00:01:31,009 --> 00:01:36,000
That’s particularly good for a gnarly regular expression.
35
00:01:36,000 --> 00:01:38,008
How do we get started with this Copilot in the CLI?
36
00:01:38,008 --> 00:01:41,004
Well, you need your license, right?
37
00:01:41,004 --> 00:01:43,002
In terms of your dev box, you have
38
00:01:43,002 --> 00:01:45,006
to have the GitHub CLI installed.
39
00:01:45,006 --> 00:01:48,001
You have to sign in, get your token.
40
00:01:48,001 --> 00:01:52,000
And from there, you can run gh extension install
41
00:01:52,000 --> 00:01:55,003
to pass in the repo owner for GitHub Copilot,
42
00:01:55,003 --> 00:01:59,004
which is gitHub/gh-copilot.
43
00:01:59,004 --> 00:02:02,009
And then you can verify with gh copilot --help.
44
00:02:02,009 --> 00:02:05,001
Standard stuff, right?
45
00:02:05,001 --> 00:02:09,006
Troubleshooting, main thing I’ve found is gh auth login,
46
00:02:09,006 --> 00:02:11,003
gh auth status.
47
00:02:11,003 --> 00:02:14,000
Make sure that your token is current.
48
00:02:14,000 --> 00:02:18,005
Also, the extension is regularly revised, so make sure
49
00:02:18,005 --> 00:02:21,007
that you’re updating your GitHub CLI extensions
50
00:02:21,007 --> 00:02:24,009
with gh extension upgrade.
51
00:02:24,009 --> 00:02:27,000
I’m going to do a deep demo on this,
52
00:02:27,000 --> 00:02:30,001
so I don’t want to belabor the PowerPoint.
53
00:02:30,001 --> 00:02:32,004
Let me bring out my whiteboarding tools though
54
00:02:32,004 --> 00:02:33,007
for just a second.
55
00:02:33,007 --> 00:02:36,008
I’m in Windows terminal here, and I’m using gh.
56
00:02:36,008 --> 00:02:38,008
Gh is the GitHub CLI,
57
00:02:38,008 --> 00:02:41,006
and it’s a non-interactive command language.
58
00:02:41,006 --> 00:02:44,006
You start with gh and then you have your context.
59
00:02:44,006 --> 00:02:46,006
There’s a whole bunch of different contexts
60
00:02:46,006 --> 00:02:50,007
for pull requests, projects, packages, you name it.
61
00:02:50,007 --> 00:02:54,002
Copilot is the one that we have with this extension,
62
00:02:54,002 --> 00:02:57,004
and there’s two main commands: explain and suggest.
63
00:02:57,004 --> 00:03:01,005
Here, I’m asking the AI to explain a git rebase command.
64
00:03:01,005 --> 00:03:04,008
Comes back from the AI, and then we can go from there.
65
00:03:04,008 --> 00:03:07,000
Meant to be easy in easy out.
66
00:03:07,000 --> 00:03:11,007
Note that this is very different from our Copilot experience
67
00:03:11,007 --> 00:03:15,002
in the IDE or in the GitHub web interface.
68
00:03:15,002 --> 00:03:17,004
This is much, much different indeed.
69
00:03:17,004 --> 00:03:19,005
I love this prompt. Check this out.
70
00:03:19,005 --> 00:03:23,000
Let me bring my whiteboarding tool out again,
71
00:03:23,000 --> 00:03:26,004
Gh copilot suggests create a Git log command
72
00:03:26,004 --> 00:03:28,006
that displays a graph of the commit history
73
00:03:28,006 --> 00:03:30,006
with a colorblind-friendly format.
74
00:03:30,006 --> 00:03:33,000
Isn’t that cool? I love that.
75
00:03:33,000 --> 00:03:36,006
This is an opportunity for you to use your prompting skills
76
00:03:36,006 --> 00:03:40,007
to really get custom-fitted responses from the AI.
77
00:03:40,007 --> 00:03:43,000
It’s really great.