In the First Steps section you saw how to add help for a CLI app/command by adding it to a function's docstring.

Here's how that last example looked like:

{!../docs_src/first_steps/tutorial006.py!}

Now that you also know how to use typer.Argument(), let's use it to add documentation specific for a CLI argument.

Add a help text for a CLI argument

You can use the help parameter to add a help text for a CLI argument:

=== "Python 3.6+"

```Python hl_lines="5"
{!> ../docs_src/arguments/help/tutorial001_an.py!}
```

=== "Python 3.6+ non-Annotated"

!!! tip
    Prefer to use the `Annotated` version if possible.

```Python hl_lines="4"
{!> ../docs_src/arguments/help/tutorial001.py!}
```

And it will be used in the automatic --help option:

$ python main.py --help

// Check the section with Arguments below ๐Ÿš€
Usage: main.py [OPTIONS] NAME

Arguments:
  NAME  The name of the user to greet  [required]

Options:
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or customize the installation.
  --help                Show this message and exit.

Combine help text and docstrings

And of course, you can also combine that help with the docstring:

=== "Python 3.6+"

```Python hl_lines="5-8"
{!> ../docs_src/arguments/help/tutorial002_an.py!}
```

=== "Python 3.6+ non-Annotated"

!!! tip
    Prefer to use the `Annotated` version if possible.

```Python hl_lines="4-7"
{!> ../docs_src/arguments/help/tutorial002.py!}
```

And the --help option will combine all the information:

$ python main.py --help

// Notice that we have the help text from the docstring and also the Arguments ๐Ÿ“
Usage: main.py [OPTIONS] NAME

  Say hi to NAME very gently, like Dirk.

Arguments:
  NAME  The name of the user to greet  [required]

Options:
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or customize the installation.
  --help                Show this message and exit.

Help with defaults

If you have a CLI argument with a default value, like "World":

=== "Python 3.6+"

```Python hl_lines="5"
{!> ../docs_src/arguments/help/tutorial003_an.py!}
```

=== "Python 3.6+ non-Annotated"

!!! tip
    Prefer to use the `Annotated` version if possible.

```Python hl_lines="4"
{!> ../docs_src/arguments/help/tutorial003.py!}
```

It will show that default value in the help text:

$ python main.py --help

// Notice the [default: World] ๐Ÿ”
Usage: main.py [OPTIONS] [NAME]

  Say hi to NAME very gently, like Dirk.

Arguments:
  [NAME]  Who to greet  [default: World]

Options:
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or customize the installation.
  --help                Show this message and exit.

But you can disable that if you want to, with show_default=False:

=== "Python 3.6+"

```Python hl_lines="7"
{!> ../docs_src/arguments/help/tutorial004_an.py!}
```

=== "Python 3.6+ non-Annotated"

!!! tip
    Prefer to use the `Annotated` version if possible.

```Python hl_lines="4"
{!> ../docs_src/arguments/help/tutorial004.py!}
```

And then it won't show the default value:

$ python main.py --help

// Notice the there's no [default: World] now ๐Ÿ”ฅ
Usage: main.py [OPTIONS] [NAME]

  Say hi to NAME very gently, like Dirk.

Arguments:
  [NAME]  Who to greet

Options:
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or customize the installation.

  --help                Show this message and exit.

!!! note "Technical Details" In Click applications the default values are hidden by default. ๐Ÿ™ˆ

In **Typer** these default values are shown by default. ๐Ÿ‘€

Custom default string

You can use the same show_default to pass a custom string (instead of a bool) to customize the default value to be shown in the help text:

=== "Python 3.6+"

```Python hl_lines="9"
{!> ../docs_src/arguments/help/tutorial005_an.py!}
```

=== "Python 3.6+ non-Annotated"

!!! tip
    Prefer to use the `Annotated` version if possible.

```Python hl_lines="6"
{!> ../docs_src/arguments/help/tutorial005.py!}
```

And it will be used in the help text:

$ python main.py --help

Usage: main.py [OPTIONS] [NAME]

Arguments:
  [NAME]  Who to greet  [default: (Deadpoolio the amazing's name)]


Options:
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or customize the installation.
  --help                Show this message and exit.

// See it shows "(Deadpoolio the amazing's name)" instead of the actual default of "Wade Wilson"

Custom help name (metavar)

You can also customize the text used in the generated help text to represent a CLI argument.

By default, it will be the same name you declared, in uppercase letters.

So, if you declare it as:

name: str

It will be shown as:

NAME

But you can customize it with the metavar parameter for typer.Argument().

For example, let's say you don't want to have the default of NAME, you want to have username, in lowercase, and you really want โœจ emojis โœจ everywhere:

=== "Python 3.6+"

```Python hl_lines="5"
{!> ../docs_src/arguments/help/tutorial006_an.py!}
```

=== "Python 3.6+ non-Annotated"

!!! tip
    Prefer to use the `Annotated` version if possible.

```Python hl_lines="4"
{!> ../docs_src/arguments/help/tutorial006.py!}
```

Now the generated help text will have โœจusernameโœจ instead of NAME:

$ python main.py --help

Usage: main.py [OPTIONS] โœจusernameโœจ

Arguments:
  โœจusernameโœจ  [default: World]

Options:
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or customize the installation.
  --help                Show this message and exit.

CLI Argument help panels

You might want to show the help information for CLI arguments in different panels when using the --help option.

If you have installed Rich as described in the docs for Printing and Colors{.internal-link target=_blank}, you can set the rich_help_panel parameter to the name of the panel where you want this CLI argument to be shown:

=== "Python 3.6+"

```Python hl_lines="8  12"
{!> ../docs_src/arguments/help/tutorial007_an.py!}
```

=== "Python 3.6+ non-Annotated"

!!! tip
    Prefer to use the `Annotated` version if possible.

```Python hl_lines="7  10"
{!> ../docs_src/arguments/help/tutorial007.py!}
```

Then, if you check the --help option, you will see a default panel named "Arguments" for the CLI arguments that don't have a custom rich_help_panel.

And next you will see other panels for the CLI arguments that have a custom panel set in the rich_help_panel parameter:

$ python main.py --help

<b> </b><font color="#F4BF75"><b>Usage: </b></font><b>main.py [OPTIONS] NAME [LASTNAME] [AGE]               </b>
<b>                                                                     </b>
 Say hi to NAME very gently, like Dirk.

<font color="#A5A5A1">โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ</font>
<font color="#A5A5A1">โ”‚ </font><font color="#F92672">*</font>    name      <font color="#F4BF75"><b>TEXT</b></font>  Who to greet [default: None] <font color="#A6194C">[required]</font>      โ”‚
<font color="#A5A5A1">โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ</font>
<font color="#A5A5A1">โ•ญโ”€ Secondary Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ</font>
<font color="#A5A5A1">โ”‚   lastname      </font><font color="#A37F4E"><b>[LASTNAME]</b></font>  The last name                         โ”‚
<font color="#A5A5A1">โ”‚   age           </font><font color="#A37F4E"><b>[AGE]     </b></font>  The user&apos;s age                        โ”‚
<font color="#A5A5A1">โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ</font>
<font color="#A5A5A1">โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ</font>
<font color="#A5A5A1">โ”‚ </font><font color="#A1EFE4"><b>--install-completion</b></font>          Install completion for the current  โ”‚
<font color="#A5A5A1">โ”‚                               shell.                              โ”‚</font>
<font color="#A5A5A1">โ”‚ </font><font color="#A1EFE4"><b>--show-completion</b></font>             Show completion for the current     โ”‚
<font color="#A5A5A1">โ”‚                               shell, to copy it or customize the  โ”‚</font>
<font color="#A5A5A1">โ”‚                               installation.                       โ”‚</font>
<font color="#A5A5A1">โ”‚ </font><font color="#A1EFE4"><b>--help</b></font>                        Show this message and exit.         โ”‚
<font color="#A5A5A1">โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ</font>

In this example we have a custom CLI arguments panel named "Secondary Arguments".

Help with style using Rich

In a future section you will see how to use custom markup in the help for CLI arguments when reading about Commands - Command Help{.internal-link target=_blank}.

If you are in a hurry you can jump there, but otherwise, it would be better to continue reading here and following the tutorial in order.

Hide a CLI argument from the help text

If you want, you can make a CLI argument not show up in the Arguments section in the help text.

You will probably not want to do this normally, but it's possible:

=== "Python 3.6+"

```Python hl_lines="5"
{!> ../docs_src/arguments/help/tutorial008_an.py!}
```

=== "Python 3.6+ non-Annotated"

!!! tip
    Prefer to use the `Annotated` version if possible.

```Python hl_lines="4"
{!> ../docs_src/arguments/help/tutorial008.py!}
```

Check it:

$ python main.py --help

// Notice there's no Arguments section at all ๐Ÿ”ฅ
Usage: main.py [OPTIONS] [NAME]

  Say hi to NAME very gently, like Dirk.

Options:
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or customize the installation.
  --help                Show this message and exit.

!!! info Have in mind that the CLI argument will still show up in the first line with Usage.

But it won't show up in the main help text under the `Arguments` section.

Help text for CLI arguments in Click

Click itself doesn't support adding help for CLI arguments, and it doesn't generate help for them as in the "Arguments:" sections in the examples above.

Not supporting help in CLI arguments is an intentional design decision in Click:

This is to follow the general convention of Unix tools of using arguments for only the most necessary things, and to document them in the command help text by referring to them by name.

So, in Click applications, you are expected to write all the documentation for CLI arguments by hand in the docstring.


Nevertheless, Typer supports help for CLI arguments. โœจ ๐Ÿคทโ€โ™‚

Typer doesn't follow that convention and instead supports help to make it easier to have consistent help texts with a consistent format for your CLI programs. ๐ŸŽจ

This is also to help you create CLI programs that are โœจ awesome โœจ by default. With very little code.

If you want to keep Click's convention in a Typer app, you can do it with the hidden parameter as described above.

!!! note "Technical Details" To support help in CLI arguments Typer does a lot of internal work in its own sub-classes of Click's internal classes.