GitHub Copilot now controls your command line...

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
one of the most impressive things a programmer can do in life is type out a bunch of incoherent text into the terminal hit enter then make something cool happen 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 if you're not a good enough hacker to tell the difference I've got some good news for you GitHub co-pilot for the CLI just became generally available and turns anyone into a bash boss commandline Cowboy or some other AI generated nickname by the end of today's video you'll be able to generate and understand and any type of CLI command you could imagine never again will you be stuck in front of your computer for weeks just trying to exit Vim to get started you'll first need to have the GitHub CLI installed on your system 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 request Etc and as of yesterday it also supports co-pilot from the CLI if you're paying for co-pilot as a personal user you automatically have access to it or if your boss pay for it you might need to enable it for Enterprise the pilot CLI only has two useful commands 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 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 because it becomes really annoying to type out co-pilot suggest every time you want to use it but in this video I'm not going to use the aliases just to keep the onscreen code really clear let's assume I know nothing about computers and I just want to use the the terminal to create a new directory we can use the co-pilot suggest command and ask it to create a new directory for our source code 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 that'll print out a command in yellow which we can now run it's the maker command which you might have guessed but if you want a more in-depth explanation you can have co-pilot explain it step by step 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 or prompt that I can use to revise the original response 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 when we run it it then creates that Source directory and we're good to go 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 and as you might imagine it uses the touch command to do that now let's find out if it's a good HTML programmer by asking it to write a hello world in the index HTML file when we execute this command it looks pretty good first glance but then when I try to run it I get this error where bash is having a problem with the bang 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 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 emit abbreviation hit Tab and generate our hello world that way 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 both of those topics on fireship iio which you can access as a pro member or individually for $10 and next week I'll have a new strip payments course out if you're interested in building software as a service type products but now let's find out if the CLI can actually run this app 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 then eventually it gave me a python command to serve locally and this command worked perfectly fine as you can see here that wouldn't have been my first choice of a command but it works now let's try something a little more complicated in the HTML I'm going to add a phone number then I'm going to prompt co-pilot to come up with a command that can search this entire project for any files that have patterns with phone numbers it returns this big long command that looks like some kind of alien language unless you're a Linux Guru like what does fine do what does grep do and what is this weird pattern here I could use my 15 years of human expertise to explain it to you or you could just have co-pilot do that where it explains how fine looks in your current directories and grep matches this regular expression to look for any phone number patterns it's hard to believe but there are programmers out there who can write code like this using nothing but their own brains I suppose nothing hurts you only pains luckily for you you can allocate that brain space to something else like a new Tik Tok dance when we paste the command into the terminal it successfully searches and finds all the phone number patterns but now it's time for the grand finale as you can see here I have this MP4 video which contains a short clip of the world's greatest actor and Governor what I want to do is use a tool called FFM Peg to convert it to an animated gif and yes I said GIF with a hard G to get a bunch of hateful comments from the United GIF Alliance in order to increase engagement on this video but the end result from our prompt is this long command that'll look completely foreign if you've never used FFM Peg it's an awesome tool that I have a separate video about but let's just go ahead and run it and see if it works and of course it works perfectly turning the video clip into a gif the bottom line is that the co-pilot CLI makes all these amazing command line Tools in Linux and Powershell accessible to anyone with very little effort and finally the last thing I want to mention is that if you don't want to pay Microsoft 10 bucks a month to use co-pilot there are some great free Alternatives like codium just throwing that out there for anyone who's already spending way too much money on AI like me thanks for watching and I will see you in the next one
Info
Channel: Beyond Fireship
Views: 285,572
Rating: undefined out of 5
Keywords:
Id: P8MfgV9us4o
Channel Id: undefined
Length: 5min 14sec (314 seconds)
Published: Fri Mar 22 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.