GitHub Copilot now controls your command line...

Fireship · Beginner ·💻 AI-Assisted Coding ·2y ago

Key Takeaways

This video demonstrates how to use GitHub Copilot in the command line interface (CLI) to generate and understand various CLI commands, including Linux and Git commands, and how to use it to automate tasks and learn new skills.

Full Transcript

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

Original Description

Learn how to become a Bash or PowerShell guru by using GitHub Copilot in the CLI. This new feature is a great way to learn Linux and Git commands without ever leaving your IDE. Check out the Fireship VS Code course https://fireship.io/courses/vscode-tricks/ GitHub copilot in the CLI https://github.blog/changelog/2024-03-21-github-copilot-general-availability-in-the-cli FFmpeg in 100 Seconds https://youtu.be/26Mayv5JPz0
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Beyond Fireship · Beyond Fireship · 37 of 42

1 Social Media Style Number Formatting in JS
Social Media Style Number Formatting in JS
Beyond Fireship
2 I used 3 different File System APIs in Node.js
I used 3 different File System APIs in Node.js
Beyond Fireship
3 Time is Relative, even in JavaScript
Time is Relative, even in JavaScript
Beyond Fireship
4 How to NOT Screw Up Firebase Environment Variables
How to NOT Screw Up Firebase Environment Variables
Beyond Fireship
5 How to make your JavaScript Bundle Smaller
How to make your JavaScript Bundle Smaller
Beyond Fireship
6 Subtle, yet Beautiful Scroll Animations
Subtle, yet Beautiful Scroll Animations
Beyond Fireship
7 Beyond Surreal? A closer look at NewSQL Relational Data
Beyond Surreal? A closer look at NewSQL Relational Data
Beyond Fireship
8 How to Build a Discord Bot
How to Build a Discord Bot
Beyond Fireship
9 How to make Eyeballs that Follow You Around
How to make Eyeballs that Follow You Around
Beyond Fireship
10 Reverse Engineer Google’s NASA Dart Easter Egg with CSS
Reverse Engineer Google’s NASA Dart Easter Egg with CSS
Beyond Fireship
11 Generate Images Programmatically on the Edge
Generate Images Programmatically on the Edge
Beyond Fireship
12 WTF are all these config files for?
WTF are all these config files for?
Beyond Fireship
13 NEW Firebase Features Just Dropped
NEW Firebase Features Just Dropped
Beyond Fireship
14 Next.js 13 - The Basics
Next.js 13 - The Basics
Beyond Fireship
15 Make Crazy Art with the NEW OpenAI Dall-e API
Make Crazy Art with the NEW OpenAI Dall-e API
Beyond Fireship
16 How to Setup Node.js with TypeScript in 2023
How to Setup Node.js with TypeScript in 2023
Beyond Fireship
17 Dramatically improve website speed with Partytown
Dramatically improve website speed with Partytown
Beyond Fireship
18 The easiest realtime app I’ve ever built
The easiest realtime app I’ve ever built
Beyond Fireship
19 10 Rendering Patterns for Web Apps
10 Rendering Patterns for Web Apps
Beyond Fireship
20 You don't need Node to use NPM packages
You don't need Node to use NPM packages
Beyond Fireship
21 Sorting Algorithms Explained Visually
Sorting Algorithms Explained Visually
Beyond Fireship
22 ChatGPT Official API First Look
ChatGPT Official API First Look
Beyond Fireship
23 I built an image search engine
I built an image search engine
Beyond Fireship
24 Industrial-scale Web Scraping with AI & Proxy Networks
Industrial-scale Web Scraping with AI & Proxy Networks
Beyond Fireship
25 Next.js Server Actions...  5 awesome things you can do
Next.js Server Actions... 5 awesome things you can do
Beyond Fireship
26 The ultimate guide to web performance
The ultimate guide to web performance
Beyond Fireship
27 I built a fullstack PaLM AI app in just 2 minutes
I built a fullstack PaLM AI app in just 2 minutes
Beyond Fireship
28 I tried 8 different Postgres ORMs
I tried 8 different Postgres ORMs
Fireship
29 I built a *streaming* AI chat app
I built a *streaming* AI chat app
Fireship
30 React VS Svelte...10 Examples
React VS Svelte...10 Examples
Fireship
31 How GitHub Actions 10x my productivity
How GitHub Actions 10x my productivity
Fireship
32 PROOF JavaScript is a Multi-Threaded language
PROOF JavaScript is a Multi-Threaded language
Fireship
33 Mind-blowing page animations are easy now... View Transitions API first look
Mind-blowing page animations are easy now... View Transitions API first look
Fireship
34 I built an Apple Vision Pro app... visionOS tutorial
I built an Apple Vision Pro app... visionOS tutorial
Fireship
35 This UI component library is mind-blowing
This UI component library is mind-blowing
Fireship
36 How I deploy serverless containers for free
How I deploy serverless containers for free
Fireship
GitHub Copilot now controls your command line...
GitHub Copilot now controls your command line...
Fireship
38 Build better payment forms using new “embedded” Stripe Checkout
Build better payment forms using new “embedded” Stripe Checkout
Fireship
39 Does Deno 2 really uncomplicate JavaScript?
Does Deno 2 really uncomplicate JavaScript?
Fireship
40 JavaScript performance is weird... Write scientifically faster code with benchmarking
JavaScript performance is weird... Write scientifically faster code with benchmarking
Fireship
41 Is Next.js 15 any good? "use cache" API first look
Is Next.js 15 any good? "use cache" API first look
Beyond Fireship
42 I built a DeepSeek R1 powered VS Code extension…
I built a DeepSeek R1 powered VS Code extension…
Fireship

This video teaches how to use GitHub Copilot in the CLI to generate and understand CLI commands, and how to use it to automate tasks and learn new skills. It covers various topics such as Linux and Git commands, and introduces tools like FFMPEG.

Key Takeaways
  1. Install GitHub CLI
  2. Enable GitHub Copilot in the CLI
  3. Use the co-pilot suggest command to generate CLI commands
  4. Use the co-pilot explain command to understand CLI commands
  5. Use FFMPEG to convert video to GIF
💡 GitHub Copilot in the CLI can make it easy for anyone to generate and understand CLI commands, and automate tasks, even with little prior knowledge.

Related AI Lessons

Reading Anthropic's "When AI Builds Itself" Changed How I Think About AI and Software Engineering
Learn how Anthropic's essay on AI building itself impacts software engineering and AI development
Dev.to · Hemapriya Kanagala
When AI Writes Most of My Code: What Happens to My Identity as a Software Engineer?
Explore how AI coding tools impact your identity as a software engineer and learn to adapt to the changing landscape of software development
Medium · AI
When AI Writes Most of My Code: What Happens to My Identity as a Software Engineer?
Explore how AI coding tools impact software engineer identity and adapt to the changing landscape
Medium · Programming
How AI Is Changing Software Development (2023–2026)
Learn how AI is revolutionizing software development with automated coding tools and techniques, increasing productivity and efficiency
Medium · Machine Learning
Up next
Azure Security Priorities for 2026: Identity, Governance, AI Security & Zero Trust
Valto Microsoft Specialists
Watch →