Your support is very much appreciated. Thanks, guys!
AI Generated·May contain errors
Video Summary
AI Generated
The speaker introduces \"vidman,\" a command-line tool developed with AI assistance to provide quick access to \"video man pages\"—short tutorials and documentation for Linux/GNU utilities. The video covers the project's goals, the AI-driven development process, the technical inner workings of the script, and the installation process via Makefile and Arch Linux packages.
So for the last year or so,
one of the projects that I've been slowly working on
is making video man pages.
Video man pages are essentially short videos,
typically five minutes, maybe 10 minutes at most,
where I talk about some of the standard
like GNU core utils,
you know, some of your standard shell utilities
that is found on a Linux machine.
And I discuss some of the most common flags and options,
the most common ways to use these particular utilities.
And from the beginning of this project,
one of the things I wanted to do,
I wanted to build up a rather large database
of these videos.
Right now, I've made 36 video man pages,
not as many as I would like.
I'd like to push that number to 50 soon.
I'd like to eventually push it to a hundred,
but you know, making videos is a tedious,
slow kind of task.
But as this video man page database grows,
I think people need an easier way
to search for these on a Linux system.
So I wanted to create a program
that you could quickly pull up any of these video man pages.
So what I did, let me move over to the desktop here.
Actually, this is my, obviously my YouTube channel, right?
And you can see some of the video man pages.
Recently, I did one on NL,
which is the number lines program,
the yes command, a base name, you know,
but again, I started these about a year ago
and I've got about 36 of them, I believe.
If I go to my playlist, yeah, video man pages,
there's 36 videos there.
And if I go to my GitLab,
I do have a vid man repository here.
Let's actually take a look at this.
And when you visit the repo here, of course,
the main page is the readme.org
and that is what is being rendered here,
which is essentially a table of all the commands
that I've covered, a link to the YouTube video,
as well as a link to an org document
that covers the commands that I covered on video,
because I have this docs directory, for example.
And if you wanted to see the commands
that I demonstrated on my awk video,
go to the awk.org file.
And there is essentially the commands
that I demonstrated on that video.
And since I've got all of this
in a nice, neat GitLab repository,
I wanted a program where the user could go to a terminal
and type vid man cat and get the video
or the org doc from the video about the cat command.
And this is a very simple thing to do.
I could write a simple bash script
and probably spend a couple of hours
playing around with some bash and I could get this done.
Then I would need to create a make file
so people could install it.
I also needed to create a package build
so people could install it on Arch Linux,
just using the make package command.
But I was like, hey, why do I need to waste
a couple of hours doing this
when I could just ask Claude?
So last night, and I know people hate this,
DT, why do you use these large language models
to do this stuff that you could do?
Well, why would I spend a couple of hours
doing something that Claude,
literally I told Claude in one paragraph
exactly what I wanted.
Claude came back and asked me four or five questions here.
I told it, hey, what programming language
do you want to do this in?
And on Linux, because most Linux machines
are going to have bash there.
And Python is also a pretty good option.
He's like, hey, you want bash, you want Python,
or do you want something else?
I said, bash.
And then he asked, hey, how should viewing the video work?
Should we just open the link in the browser
or would you rather have the link open
in a standard media player like MPV?
And I said, why not offer both options?
And then he asked, okay, reading the org docs,
how are we going to do that?
If you're doing this at a terminal or in a TTY,
what should we open these org documents with?
And we're going to use the less command
because less, one of the standard GNU core utilities,
we know it's there.
And then finally, where should the docs slash data
live for the installed tool?
And I think what he was asking here is the org docs.
Should we just always pull them down from the internet,
from your GitLab, or when we install the VidMan package,
should we just download all those org documents
and have them locally installed on your system?
And obviously that's the better option here.
And other than that, Claude, I gave him that input.
He took about, I don't know, maybe five minutes, right?
And he's spitting out a lot of explanations
of what each of the files he's creating,
created a tar file here that contained all the scripts.
And other than that, I don't think I had anything to do.
Once I tested the program, I tested both install methods,
both the make file and the package build for Arch.
And there was one minor error because he assumed
that on GitLab, my main branch
was still called the master branch.
But remember, GitLab decided to rename all the branches
from master to main a few years ago
because a master branch apparently is racist.
We've got to rename everything to the main branch,
even though it breaks a lot of things,
breaks a lot of documentation.
Even Claude, who's pretty smart,
is still going to the internet
and assuming things are still the master branch.
But, you know, we needed to make that change, right?
So, hey, whatever.
But, you know, this is really cool
because I gave, you know, a very short paragraph
of exactly what I needed.
He asked me four questions.
I answered those four questions.
And within five minutes, I have the VidMan script
and then some data here,
which contains a commands.tsv file.
TSV, that's a tab separated values,
kind of like CSV, it's comma separated values.
If I open this, this is just a list
of the names of the commands plus the URLs, right?
He just pulled that from the readme.org, right?
The script is just going to pull all that information
from the readme.org that I already maintain anyway.
And then we've got tools in here
and this is a gen commands.tsv.
So this is the script that actually generates that TSV file
that sorts it by the command and the URL.
So, you know, pretty simple stuff.
And of course, here's the thing.
I know people complain,
hey, you don't know what Claude is doing on this stuff.
Well, no, I actually do.
I could have done this work, right?
If I really wanted to spend a few hours
and do all this work myself,
I absolutely could have done this myself.
But why?
What is the purpose of that, right?
I don't want to spend that time.
This is not enjoyable to me.
I don't like scripting.
I don't like programming.
I just want to get stuff done.
So I let Claude do it in five minutes.
Now I can go check Claude if I want to.
I could certainly go and audit the code here in Claude.
Matter of fact, let me open the VidMan script here in Emacs.
I mean, if I wanted to, let me zoom in.
I wanted to go in here and actually check it out.
I can, a matter of fact, let's do this.
And it was essentially the first time
I've really looked at this on camera in detail.
But what is exactly going on here in this script?
And if we start at the top,
you have your shebang, right?
User, bin, bash, and then some comments.
It's typically how I start all of my bash scripts anyway.
And typically I also have this here, set-EUOPipeFill.
And that's just a way to check for some errors.
You've got prog equals VidMan.
So this is a variable name, the program name.
What's the program name?
VidMan.
So when we run the command later,
we're going to use VidMan as the name of the program here.
And you can see, we also have help information
also in the comments.
So we know all the flags and options
that are available right up front.
Then just checking out the code,
making sure there's nothing that looks crazy or unsafe here.
The first thing, we've got a function here,
resolve share directory.
And we've got comments here to explain this.
So even if you didn't really know
what the bash scripting here was,
and we're locating the data directory.
I believe that's the directory
that contains that TSV file, right?
We need to find that file.
And here are some directories to look into
to see if you can find that file.
And then you've got this for loop here
where we're searching this list of directories
and we're looking for commands.tsv.
Pretty standard stuff, right?
This is not very complicated at all.
We have some similar functions here,
resolve docs directory,
kind of like we were resolving the data directory, right?
We're now looking for those org documents
for each of the commands,
alt.org, cat.org, et cetera.
And we're doing similar functions for that.
So we can go find the directories
that contain those org docs.
And then config file.
So there is a .config, vidman config,
simple key equals value lines.
That is interesting.
I actually did not know that I could,
if I wanted to, create a config file
for the vidman command.
I don't think it actually creates one out of the box.
But if I want to, I can, on this system,
I could go create this file,
which doesn't exist right now.
But if I wanted to,
it tells me exactly what I could do.
Key equals value.
For example, config file.
I could go write config file equals,
and then give it config file equals
the location to where I want the config file,
if I didn't want this location.
I could also, in that config file,
do config underscore player equals,
and tell it what I want for the video player.
I believe it defaults to MPV,
but if I wanted to use something else,
I could specify.
And again, I didn't know this was here,
but this is pretty interesting.
And it's obvious what is going on
in this script, because again,
I know some bash scripting.
People will assume when you use
these large language models,
you must not know what the hell you're doing,
because why would you use it?
I just didn't want to have to write all this crap out.
Plus, Claude is pretty smart.
He's going to come up with things
that originally I would not have asked for.
In fact, when I gave my little paragraph,
as far as the prompt,
hey, I want you to create this program,
I did not tell him I wanted a config file.
It makes sense to have the config file there, though.
I'm glad he added it.
And again, that's something
I probably wouldn't have added
had I done it myself.
And now that he has added it,
I think that's a pretty smart idea.
Next up, we've got some helper functions.
So these are just bash functions.
Usage, he's running a sed command here,
sed substitution.
It looks like we're getting rid
of the commented lines in some of the org documents.
And this is just pulling out information,
names of commands from the readme.org,
or printing out some of the command.org files.
Some of the stuff that doesn't need to be printed
would be, for example, commented lines.
We don't need those.
List commands, this function here
is listing all the commands in the TSV file.
So we're going to cut out the names of the commands
and then sort them alphabetically.
And when we run the command,
it will print all that out.
And I could go through the rest of this,
but you get the idea.
I know exactly what this script is doing.
So let's actually try the script out.
Let me open a terminal.
Let me clear the screen.
Let me zoom in.
So if I run VidMan with no options here,
oh, it's not installed locally here.
So let's actually install it.
So let me actually CD into my
NC GitLab repo slash VidMan repository here.
And you can see I've got both the makefile
and the package build.
Which one should I install?
Well, on Arch, typically I would use the package build,
but I can use the makefile.
The makefile is appropriate on any distro.
Well, to test things out,
I think I'll install it both ways
just to make sure both actually work.
So let's start with the makefile.
Sudo make, if I can type correctly, install.
Give it my super secure password here.
And it says permission denied.
Let me up arrow.
Maybe I should have just done a make install.
Nope, make install is not going to work either.
So we have run into a issue.
Tools, gen command script.
It's trying to write to data commands dot TSV.
And it says permission is denied.
Let me make sure that we have,
we don't have any weird permission
or owner problems in some of this.
So let me go in here.
And one of the things I'm going to do,
I opened a file manager and went to this repo.
And I noticed that tools gen commands TSV,
which is the script it was complaining about,
it did not have execute permissions.
It was set to execute nobody.
So I put that to execute owner.
So now it is executable.
So now if I go back into the terminal
and do a sudo make install, that installs just fine.
So that was not a problem with the code or anything.
That was just installing it here locally on my machine.
I've got to make sure that those scripts
have execute permissions.
But you can see it installed just fine.
So now let's test it out.
If I do vidman with no flags or options,
we get the help information, right?
It just prints out basically a man page.
I didn't create a proper man page,
but the help here is fine.
It's such a small little script anyway.
I didn't want to take the time to do a man page.
I think just vidman with no flags and options,
giving you the help information is fine.
Of course, I could have also just typed dash H for help
for the same information.
You can see we've got a list of six flags,
dash W, R, B, M, L, or H.
Now, if I want to watch something, vidman dash W,
let's watch the video on the LS command.
It's got to pull it down from the internet
and then it opens it by default with MPV.
All right, let's close that.
So that's a dash W for watch.
And by default, that's going to open in MPV.
You could specify a different video player though.
But if I up arrow and do dash B for browser LS,
that's going to, that actually didn't do anything.
It gives me a menu system here.
Let me queue out of that.
Let me actually read the help information.
Dash B must be used with dash W.
So let me up arrow, dash W for watch,
dash B for watching the browser LS.
And that just opened the video in my browser.
Of course, you guys wouldn't see it
because the video was off screen,
but it did open that correctly.
If I type vidman and then some command cat
without any flags or options,
then it doesn't know what I want to do.
Do I want to watch the video in MPV,
watch the video in the browser,
or read the org docs that also got downloaded?
Maybe I want to read the org doc.
Let me type three and it's going to open the org doc
using the LS command, the standard LS,
GNU core util here, where I could read a little bit
about the cat command.
Those are the same cat commands
that I actually used in the cat video,
which is really neat.
You can watch the video.
You can also read the document as you're watching the video
to see the commands I use.
So there you have it,
a little bit of the vidman command right in action,
but let me actually test the package build install.
To test the package build install,
I probably should uninstall via the make file.
So let's sudo make uninstall
to see if the uninstall works.
It looks like it did.
And now let me actually make pkg-si.
So you need to do this inside a directory
that contains an arch package build.
There is an arch package build.
And if I run this, error,
one or more files did not pass validity check.
So vidman-1.0.0.tar.gz fill,
let me LS.
So it pulled that down,
but I guess it didn't like possibly a validity check.
Is that gonna be the hash on that?
If I vim the package build here,
we've got source and then package name.
Then we've got the SHA-256 sums here.
I wonder if I need to update that.
So to update that,
I think update package sums would be the command.
Or maybe I didn't do that right.
Or maybe that command is not here.
That may be part of some of the pacman extras package.
So let's sudo pacman-S for install.
This will be part of pacman-contrib.
The pacman-contrib is some extra scripts that are useful,
especially if you build arch packages
and do interesting things like I'm doing,
creating these package builds, right?
So now let me do the update package sums.
That's not quite right.
Was it upd?
What is the name of the command?
Pretty sure this is, okay.
There it is.
Updpkgsum, okay.
Remember the command was something similar to that.
There we go.
And now let me up arrow.
And I'm going to once again,
makepkg.si and see if this installs correctly.
Now that, yeah, that was it.
We just needed to update the sum.
I think I mistyped the password there.
All right, now let's see if bidman works.
Bidman, yeah, there we go.
And two, watch it in the browser.
It opens off screen in the browser.
There you go.
So the installation with the package build on arch works.
The makefile installation also worked as well.
So there you have it.
A little bit of an update with the vidman project there.
So now it's an installable package on arch.
You can use the package build on every Linux distribution.
You can use the makefile to install that thing
and then type vidman name of program.
By the way, if you don't know
which of the programs I've done on video,
there was a list flag vidman-l to get a list
of all of the commands that I've already covered on camera.
Peace guys.