it can be frustrating but it was likely left out because writing a CLI is predicated by having seen this notation used in the documentation when using a CLI.
to answer your question though (and a bit extra because i was there once too):
when you see $
this is almost always used to indicate that everything after the $
is a single line to paste into the command line (shell) and hit enter. it will usually be in this general form
$ program command <required arg> [optional arg]
you will likely come across these two other symbols that confused me as well:
<>
means this is a required argument for this command
[]
means this is an optional argument for this command
and if you see a comma and / or ellipses it means multiple required / optional args:
$ program command <require arg(s), ...> [optional arg(s), ...]
and heres an example youll likely come across a lot to demonstrate:
$ git clone <source repo url> [/path/for/clone]
the source repo url is <required>
and the path where the clone will be copied to is [optional]
(defaulting the current working directory in your command line shell). you can view this with:
$ cwd
extra extra bit, if you see things like -a
or --something
these are called CLI flags. they are often used as modifiers for a
certain command. heres an example thats useful to create and checkout a new git branch in one go:
$ git checkout -b <branch name>
where -b
is a flag that modifies the checkout
command of the git
program that tells it to create the branch before checking it out
and the flag that will likely be most helpful for you in any case (most good CLIs will support this)
$ program --help
# or
$ program -help
cheers man good luck on the journey