WEBVTT

1
00:00:01.539 --> 00:00:10.760
Now, besides adding context and participants to chat, GitHub Copilot chat also offers you

2
00:00:10.760 --> 00:00:16.020
these slash commands, which you also see here on my screen and some other slash commands

3
00:00:16.459 --> 00:00:23.240
to quickly invoke various functionalities that are supported by GitHub Copilot.

4
00:00:25.120 --> 00:00:30.960
So if I type a slash here, I'll actually see some of these suggestions down here and

5
00:00:30.960 --> 00:00:32.580
also up here.

6
00:00:33.460 --> 00:00:40.880
For example, I can use at terminal slash explain to explain some command I currently have in

7
00:00:40.880 --> 00:00:44.600
my terminal or some command I currently have selected.

8
00:00:46.990 --> 00:00:53.440
I can also, and that's sometimes even more useful, use the inline chat and for example

9
00:00:53.460 --> 00:01:01.320
select some code and then use a slash command here to quickly invoke a command, a feature

10
00:01:01.320 --> 00:01:07.720
if you want to call it like this, provided by GitHub Copilot that will take this selected

11
00:01:07.720 --> 00:01:12.320
code into account or that will take this selected code as a base.

12
00:01:13.320 --> 00:01:19.640
For example, if I use slash explain with this code selected, I don't need to type anything

13
00:01:19.620 --> 00:01:20.020
else.

14
00:01:20.240 --> 00:01:27.440
I could to add more instructions or more context, but I can also run it like this to have this

15
00:01:27.440 --> 00:01:29.700
code be explained to me.

16
00:01:30.480 --> 00:01:35.640
I could add more information if I wanted to specify which kind of explanation I'm looking

17
00:01:35.640 --> 00:01:40.960
for, but if I run it like this, you see it will open up this little window here and it

18
00:01:40.960 --> 00:01:43.020
will explain that code for me here.

19
00:01:43.540 --> 00:01:48.680
Of course, it can be a bit annoying to browse that here, so I can always click view in chat

20
00:01:48.660 --> 00:01:51.900
and I have the entire explanation here in my chat now.

21
00:01:52.900 --> 00:01:59.360
And besides slash explain, I could also run slash fix if there is some problem with that

22
00:01:59.360 --> 00:02:01.400
code and I want Copilot to fix it.

23
00:02:02.000 --> 00:02:06.280
I also might want to add some text here then where I describe the problem.

24
00:02:09.179 --> 00:02:18.380
Like I don't want to use the logging package and it will now fix that code, taking my instruction

25
00:02:18.460 --> 00:02:21.400
into account and go back to the print statement, for example.

26
00:02:23.140 --> 00:02:26.340
And I could now accept this or discard it if I don't want it.

27
00:02:26.440 --> 00:02:29.660
And here I'll discard it because I'm happy with the logging package.

28
00:02:29.800 --> 00:02:33.120
But that would have been one way of using this fix command.

29
00:02:34.280 --> 00:02:41.320
Now of course, I could have also described my intent without fix, like I don't want to

30
00:02:41.300 --> 00:02:43.780
use the logging package.

31
00:02:44.220 --> 00:02:49.040
And chances are high that it would have worked as well, as you can tell.

32
00:02:51.100 --> 00:02:55.680
But by using slash fix, you're adding some extra context again.

33
00:02:55.840 --> 00:03:00.680
And using these AI chat tools is all about context.

34
00:03:00.680 --> 00:03:06.160
It's always about adding the right context in the right place, because with this slash

35
00:03:06.260 --> 00:03:10.260
fix command, we make it very clear that we want to fix this code.

36
00:03:11.700 --> 00:03:17.440
And therefore, for certain commands where sometimes GitHub Copilot might not always

37
00:03:17.440 --> 00:03:23.740
give us the right response, the right result, adding little extra pieces of context like

38
00:03:23.740 --> 00:03:27.560
this can make the difference, which is why it's important to know about it.

39
00:03:29.329 --> 00:03:33.740
Now another very useful slash command is slash tests.

40
00:03:34.020 --> 00:03:36.440
And we'll explore this in the next lecture.

