ฝึกพูดภาษาอังกฤษด้วยเทคนิค Shadowing จากวิดีโอ: GitHub Copilot now controls your command line...
กำลังโหลด...
1
One of the most impressive things a programmer can do in
2
life is type out a bunch of incoherent text into the terminal, hit enter, then make something cool happen.
3
Maybe this command is just searching for a text pattern in some files, or maybe it's about to take down the nation's entire power grid.
4
If you're not a good enough hacker to tell the difference, I've got some good news for you.
5
GitHub Copilot for the CLI just became generally available and turns anyone into a bash boss, command line cowboy, or some other AI-generated nickname.
6
By the end of today's video, you'll be able to generate and understand any type of CLI command you could imagine.
7
Never again will you be stuck in front of your computer for weeks just trying to exit Vim.
8
To get started, you'll first need to have the GitHub CLI installed on your system.
9
If you don't already have it, it's a tool that's linked to your GitHub account and allows you to basically manage everything from the CLI, like your GitHub repos, pull requests,
10
etc. And as of yesterday, it also supports Copilot from the CLI.
11
If you're paying for Copilot as a personal user, you automatically have access to it, or if your boss pays for it, you might need to enable it for enterprise.
12
The Copilot CLI only has two useful commands.
13
Explain, which will take a command and then explain what it does, and Suggest, which as the name suggests, will try to create a command based on your instructions.
14
Now, before we go any further, one thing I want to point out is that you can also create aliases for these commands, which I would highly recommend doing in real life,
15
because it becomes really annoying to type out copilot suggest every time you want to use it.
16
But in this video, I'm not going to use the aliases just to keep the on-screen code really clear.
17
Let's assume I know nothing about computers, and I just want to use the terminal to create a new directory.
18
We can use the copilot suggest command and ask it to create a new directory for our source code.
19
That'll give us the option to choose between a git command, a github cli command, or in our case what we want is a generic shell command.
20
That'll print out a command in yellow, which we can now run.
21
It's the make dir command, which you might have guessed, but if you want a more in-depth explanation, you can have Copilot explain it step by step.
22
In addition, I don't like the name it chose for the directory, so I can have it revise that command by providing a secondary shot
23
or prompt that I can use to revise the original response.
24
By default, it will copy the command to your clipboard so you can then paste it in yourself, but you can also configure it to run the command automatically.
25
When we run it, it then creates that source directory, and we're good to go.
26
But now we also want a JavaScript HTML and CSS file in that directory, so let's go ahead and ask it to generate those as well.
27
And as you might imagine, it uses the touch command to do that.
28
Now let's find out
29
if it's a good HTML programmer by asking it to write a hello world in the index HTML file.
30
When we execute this command, it looks pretty good at first glance, but then when I try to run it, I get this error where Bash is having a problem with the bang.
31
That's because it's not properly escaped from the HTML string, which I would think a sophisticated AI would be able to catch, but apparently not.
32
It's pretty stupid on my part to be doing HTML programming from the CLI anyway, so let's just go into the index.html file, use an exclamation mark for the Emmet abbreviation,
33
hit tab, and generate our hello world that way.
34
By the way, if you want to get better at using tools like VS Code as well as Git and GitHub, I have courses for both of those topics on Fireship.io,
35
which you can access as a pro member or individually for $10.
36
And next week I'll have a new Stripe payments course out if you're interested in building software as a service type products.
37
But now let's find out if the CLI can actually run this app.
38
When I initially asked it to serve the app locally, it didn't seem to understand that command, and it required me to add a secondary prompt to explain in more detail what I wanted,
39
then eventually it gave me a Python command to serve locally.
40
And this command worked perfectly fine, as you can see here.
41
That wouldn't have been my first choice of a command, but it works.
42
Now let's try something a little more complicated.
43
In the HTML, I'm going to add a phone number.
44
Then I'm going to prompt Copilot to come up with a command
45
that can search this entire project for any files that have patterns with phone numbers.
46
It returns this big long command that looks like some kind of alien language unless you're a Linux guru.
47
Like what does fine do, what does grep do, and what is this weird pattern here?
48
I could use my 15 years of human expertise to explain it to you, or you could just have Copilot do that, where it explains how fine looks in your current directories,
49
and grep matches this regular expression to look for any phone number patterns.
50
It's hard to believe, but there are programmers out there who can write code like this using nothing but their own brains.
51
I suppose nothing hurts you.
52
Only pain.
53
Luckily for you, you can allocate that brain space to something else, like a new TikTok dance.
54
When we paste the command into the terminal, it successfully searches and finds all the phone number patterns.
55
But now it's time for the grand finale.
56
As you can see here, I have this mp4 video, which contains a short clip of the world's greatest actor and governor.
57
What I want to do is use a tool called ffmpeg to convert it to an animated gif. And yes, I said gif with a hard g to get a bunch
58
of hateful comments from the United GIF Alliance in order to increase engagement on this video.
59
But the end result from our prompt is this long command that'll look completely foreign if you've never used ffmpeg.
60
It's an awesome tool that I have a separate video about.
61
But let's just go ahead and run it and see if it works.
62
And of course it works perfectly, turning the video clip into a GIF.
63
The bottom line is that the Copilot CLI makes all these amazing command line tools in Linux
64
and PowerShell accessible to anyone with very little effort.
65
And finally, the last thing I want to mention is that
66
if you don't want to pay Microsoft 10 bucks a month to use Copilot, there are some great free alternatives like Codium.
67
Just throwing that out there for anyone who's already spending way too much money on AI like me.
68
Thanks for watching, and I will see you in the next one.
เกี่ยวกับบทเรียนนี้
คุณกำลังฝึกภาษาอังกฤษกับ "GitHub Copilot now controls your command line..." ด้วยเทคนิค Shadowing — วิธีที่พัฒนาขึ้นสำหรับการฝึกนักแปลมืออาชีพ
ฟังทีละประโยค สังเกตการเน้นเสียงและการเชื่อมเสียง แล้วพูดตามดังๆ อย่างมั่นใจ ฝึกวันละ 15–30 นาทีจะเห็นผลลัพธ์ที่ชัดเจน
เทคนิค Shadowing คืออะไร?
Shadowing เป็นเทคนิคการเรียนรู้ภาษาที่ได้รับการรับรองทางวิทยาศาสตร์ พัฒนาขึ้นสำหรับการฝึกนักแปลมืออาชีพ วิธีการนี้เรียบง่ายแต่ทรงพลัง: คุณฟังเสียงภาษาอังกฤษจากเจ้าของภาษาและพูดตามทันที — เหมือนเงาที่ตามผู้พูดด้วยช่วงเวลาห่าง 1-2 วินาที การวิจัยแสดงว่าเทคนิคนี้ปรับปรุงความแม่นยำในการออกเสียง ทำนองเสียง จังหวะ การเชื่อมเสียง การฟังเข้าใจ และความคล่องแคล่วในการพูดได้อย่างมีนัยสำคัญ