subscribe

Use ChatGPT to come up with FFmpeg CLI commands

It often happens to me that I need to run some cli command and I know exactly what I'm trying to accomplish, but I can't remember how the tool I'm using works and which flags it provides. Especially when using ImageMagick or FFmpeg.

In the past I used to either read the docs to try to find what I need, or google my question. But since ChatGPT came out, I started using it to write my cli commands for me. I tell it what my OS is and what I want to accomplish, and then it returns the exact command I need and also the explanation for each flag.

It's not only much faster but also sometimes it suggests options I didn't even know about, so I get to learn a new way of doing something. It became such a common use case for me that I built a cli tool that does exactly that, but right in the terminal. It's called help-cli and it's open source and uses your own OpenAI api key.

I built it using nodejs, react and INK. You can install it by running:

$ npm i -g help-cli

After you run it for the first time, it'll ask you for your OpenAI api key that you can get from here: platform.openai.com/account/api-keys.

In the video above I show an example how I use it to crop a video, using FFmpeg. I also go over the code, how it makes calls to the OpenAI api and which prompts it uses.

I plan to make another video in which I'll go over how INK works. I also want to modify help-cli to start using the new function calling option of OpenAI.

To get notified about all the new posts, videos and projects, join my newsletter: newsletter.undefinedapps.com

And don't forget to subscribe on youtube: youtube.com/@BiteSizeAcademy