📝 Update link syntax to minimal Markdown (#1623)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sebastián Ramírez · committed by GitHub · parent d10dff0 · Browse files · 36 files·+161 added−161 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
36 files+161 added−161 removed
- other:+161 added−161 removed
Provenance
- Commit
3780a29- Tree
3b099b9- Author
Sebastián Ramírez <tiangolo@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
d10dff0
36 files changed+161 added−161 removed
modified:docs/tutorial/arguments/envvar.md+1 added-1 removed
2 unmodified lines345677891011107 unmodified linesExpand all2 unmodified linesYou can also configure a *CLI argument* to read a value from an environment variable if it is not provided in the command line as a *CLI argument*.
/// tip
You can learn more about environment variables in the [Environment Variables](../../environment-variables.md){.internal-link target=_blank} page.You can learn more about environment variables in the [Environment Variables](../../environment-variables.md) page.
///
To do that, use the `envvar` parameter for `typer.Argument()`:107 unmodified linesExpand allmodified:docs/tutorial/arguments/help.md+2 added-2 removed
183 unmodified lines184 ## *CLI Argument* help panels185 186 You might want to show the help information for *CLI arguments* in different panels when using the `--help` option.187 188-If you have installed Rich as described in the docs for [Printing and Colors](../printing.md){.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:188+If you have installed Rich as described in the docs for [Printing and Colors](../printing.md), you can set the `rich_help_panel` parameter to the name of the panel where you want this *CLI argument* to be shown:189 190 {* docs_src/arguments/help/tutorial007_an_py310.py hl[12,16] *}191 192 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`.26 unmodified lines219 In this example we have a custom *CLI arguments* panel named "`Secondary Arguments`".220 221 ## Help with style using Rich222 223-In a future section you will see how to use custom markup in the `help` for *CLI arguments* when reading about [Commands - Command Help](../commands/help.md#rich-markdown-and-markup){.internal-link target=_blank}.223+In a future section you will see how to use custom markup in the `help` for *CLI arguments* when reading about [Commands - Command Help](../commands/help.md#rich-markdown-and-markup).224 225 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.226 227 ## Hide a *CLI argument* from the help text40 unmodified linesmodified:docs/tutorial/arguments/optional.md+2 added-2 removed
31 unmodified lines32 </div>33 34 ## An alternative *CLI argument* declaration35 36-In the [First Steps](../first-steps.md#add-a-cli-argument){.internal-link target=_blank} you saw how to add a *CLI argument*:36+In the [First Steps](../first-steps.md#add-a-cli-argument) you saw how to add a *CLI argument*:37 38 {* docs_src/first_steps/tutorial002_py310.py hl[4] *}39 40 Now let's see an alternative way to create the same *CLI argument*:169 unmodified lines210 ```211 212 /// note213 214-If you hadn't seen that `...` before: it is a special single value, it is <a href="https://docs.python.org/3/library/constants.html#Ellipsis" class="external-link" target="_blank">part of Python and is called "Ellipsis"</a>.214+If you hadn't seen that `...` before: it is a special single value, it is [part of Python and is called "Ellipsis"](https://docs.python.org/3/library/constants.html#Ellipsis).215 216 ///217 218 {* docs_src/arguments/optional/tutorial003_py310.py hl[7] *}20 unmodified linesmodified:docs/tutorial/commands/context.md+1 added-1 removed
2 unmodified lines3 When you create a **Typer** application it always has a special, hidden object underneath called the "Context".4 5 But you can access the context by declaring a function parameter of type `typer.Context`.6 7-You might have read it in [CLI Option Callback and Context](../options/callback-and-context.md){.internal-link target=_blank}.7+You might have read it in [CLI Option Callback and Context](../options/callback-and-context.md).8 9 The same way, in commands or in the main `Typer` callback you can access the context by declaring a function parameter of type `typer.Context`.10 11 ## Getting the context114 unmodified linesmodified:docs/tutorial/commands/help.md+4 added-4 removed
211 unmodified lines212 ///213 214 ### Rich Markup215 216-If you set `rich_markup_mode="rich"` when creating the `typer.Typer()` app (which is the default), you will be able to use <a href="https://rich.readthedocs.io/en/stable/markup.html" class="external-link" target="_blank">Rich Console Markup</a> in the docstring, and even in the help for the *CLI arguments* and options:216+If you set `rich_markup_mode="rich"` when creating the `typer.Typer()` app (which is the default), you will be able to use [Rich Console Markup](https://rich.readthedocs.io/en/stable/markup.html) in the docstring, and even in the help for the *CLI arguments* and options:217 218 {* docs_src/commands/help/tutorial004_an_py310.py hl[5,11,15:17,22,25,28] *}219 220-With that, you can use <a href="https://rich.readthedocs.io/en/stable/markup.html" class="external-link" target="_blank">Rich Console Markup</a> to format the text in the docstring for the command `create`, make the word "`create`" bold and green, and even use an <a href="https://rich.readthedocs.io/en/stable/markup.html#emoji" class="external-link" target="_blank">emoji</a>.220+With that, you can use [Rich Console Markup](https://rich.readthedocs.io/en/stable/markup.html) to format the text in the docstring for the command `create`, make the word "`create`" bold and green, and even use an [emoji](https://rich.readthedocs.io/en/stable/markup.html#emoji).221 222 You can also use markup in the help for the `username` CLI Argument.223 224 And the same as before, the help text overwritten for the command `delete` can also use Rich Markup, the same in the CLI Argument and CLI Option.54 unmodified lines279 If you set `rich_markup_mode="markdown"` when creating the `typer.Typer()` app, you will be able to use Markdown in the docstring:280 281 {* docs_src/commands/help/tutorial005_an_py310.py hl[5,10,13:21,26,28:29] *}282 283-With that, you can use Markdown to format the text in the docstring for the command `create`, make the word "`create`" bold, show a list of items, and even use an <a href="https://rich.readthedocs.io/en/stable/markup.html#emoji" class="external-link" target="_blank">emoji</a>.283+With that, you can use Markdown to format the text in the docstring for the command `create`, make the word "`create`" bold, show a list of items, and even use an [emoji](https://rich.readthedocs.io/en/stable/markup.html#emoji).284 285 And the same as before, the help text overwritten for the command `delete` can also use Markdown.286 287 Check the help for the `create` command:59 unmodified lines347 ## Help Panels348 349 If you have many commands or CLI parameters, you might want to show their documentation in different panels when using the `--help` option.350 351-If you installed <a href="https://rich.readthedocs.io/" class="external-link" target="_blank">Rich</a> as described in [Printing and Colors](../printing.md){.internal-link target=_blank}, you can configure the panel to use for each command or CLI parameter.351+If you installed [Rich](https://rich.readthedocs.io/) as described in [Printing and Colors](../printing.md), you can configure the panel to use for each command or CLI parameter.352 353 ### Help Panels for Commands354 355 To set the panel for a command you can pass the argument `rich_help_panel` with the name of the panel you want to use:149 unmodified linesmodified:docs/tutorial/options/help.md+1 added-1 removed
91 unmodified lines92 Here we have a custom *CLI options* panel named "`Customization and Utils`".93 94 ## Help with style using Rich95 96-In a future section you will see how to use custom markup in the `help` for *CLI options* when reading about [Commands - Command Help](../commands/help.md#rich-markdown-and-markup){.internal-link target=_blank}.96+In a future section you will see how to use custom markup in the `help` for *CLI options* when reading about [Commands - Command Help](../commands/help.md#rich-markdown-and-markup).97 98 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.99 100 57 unmodified linesmodified:docs/tutorial/options/name.md+1 added-1 removed
30 unmodified lines31 {* docs_src/options/name/tutorial001_an_py310.py hl[9] *}32 33 /// note34 35-"<a href="https://docs.python.org/3.8/glossary.html#term-argument" class="external-link" target="_blank">Positional</a>" means that it's not a function argument with a keyword name.35+"[Positional](https://docs.python.org/3.8/glossary.html#term-argument)" means that it's not a function argument with a keyword name.36 37 For example `show_default=True` is a keyword argument. "`show_default`" is the keyword.38 39 But in `"--name"` there's no `option_name="--name"` or something similar, it's just the string value `"--name"` that goes in `typer.Option()`.278 unmodified linesmodified:docs/tutorial/options/required.md+1 added-1 removed
23 unmodified lines2425262728282930313239 unmodified lines23 unmodified lines{* docs_src/options/required/tutorial002_py310.py hl[7] *}
/// note
If you hadn't seen that `...` before: it is a special single value, it is <a href="https://docs.python.org/3/library/constants.html#Ellipsis" class="external-link" target="_blank">part of Python and is called "Ellipsis"</a>.If you hadn't seen that `...` before: it is a special single value, it is [part of Python and is called "Ellipsis"](https://docs.python.org/3/library/constants.html#Ellipsis).
///
That will tell **Typer** that it's still a *CLI option*, but it doesn't have a default value, and it's required.39 unmodified linesmodified:docs/tutorial/options/version.md+1 added-1 removed
84 unmodified lines85 ///86 87 /// note88 89-If you need a refresher about what is "standard output" and "standard error" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](../printing.md#standard-output-and-standard-error){.internal-link target=_blank}.89+If you need a refresher about what is "standard output" and "standard error" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](../printing.md#standard-output-and-standard-error).90 91 ///92 93 ### Fix with `is_eager`19 unmodified linesmodified:docs/tutorial/parameter-types/datetime.md+2 added-2 removed
1 # DateTime2 3-You can specify a *CLI parameter* as a Python <a href="https://docs.python.org/3/library/datetime.html" class="external-link" target="_blank">`datetime`</a>.3+You can specify a *CLI parameter* as a Python [`datetime`](https://docs.python.org/3/library/datetime.html).4 5 Your function will receive a standard Python `datetime` object, and again, your editor will give you completion, etc.6 7 {* docs_src/parameter_types/datetime/tutorial001_py310.py hl[1,9,10,11] *}38 unmodified lines46 ## Custom date format47 48 You can also customize the formats received for the `datetime` with the `formats` parameter.49 50-`formats` receives a list of strings with the date formats that would be passed to <a href="https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime" class="external-link" target="_blank">datetime.strptime()</a>.50+`formats` receives a list of strings with the date formats that would be passed to [datetime.strptime()](https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime).51 52 For example, let's imagine that you want to accept an ISO formatted datetime, but for some strange reason, you also want to accept a format with:53 54 * first the month31 unmodified linesmodified:docs/tutorial/parameter-types/enum.md+1 added-1 removed
1 # Enum - Choices2 3-To define a *CLI parameter* that can take a value from a predefined set of values you can use a standard Python <a href="https://docs.python.org/3/library/enum.html" class="external-link" target="_blank">`enum.Enum`</a>:3+To define a *CLI parameter* that can take a value from a predefined set of values you can use a standard Python [`enum.Enum`](https://docs.python.org/3/library/enum.html):4 5 {* docs_src/parameter_types/enum/tutorial001_py310.py hl[1,6:9,16:17] *}6 7 /// tip140 unmodified linesmodified:docs/tutorial/parameter-types/file.md+3 added-3 removed
8 unmodified lines9 You can read and write data with `Path` the same way.10 11 ///12 13-The difference is that these types will give you a Python <a href="https://docs.python.org/3/glossary.html#term-file-object" class="external-link" target="_blank">file-like object</a> instead of a Python <a href="https://docs.python.org/3/library/pathlib.html#basic-use" class="external-link" target="_blank">Path</a>.13+The difference is that these types will give you a Python [file-like object](https://docs.python.org/3/glossary.html#term-file-object) instead of a Python [Path](https://docs.python.org/3/library/pathlib.html#basic-use).14 15 A "file-like object" is the same type of object returned by `open()` as in:16 17 ```Python149 unmodified lines167 ## File *CLI parameter* configurations168 169 You can use several configuration parameters for these types (classes) in `typer.Option()` and `typer.Argument()`:170 171-* `mode`: controls the "<a href="https://docs.python.org/3/library/functions.html#open" class="external-link" target="_blank">mode</a>" to open the file with.171+* `mode`: controls the "[mode](https://docs.python.org/3/library/functions.html#open)" to open the file with.172 * It's automatically set for you by using the classes above.173 * Read more about it below.174 * `encoding`: to force a specific encoding, e.g. `"utf-8"`.175 * `lazy`: delay <abbr title="input and output, reading and writing files">I/O</abbr> operations. Automatic by default.1 unmodified line177 * `atomic`: if true, all writes will actually go to a temporal file and then moved to the final destination after completing. This is useful with files modified frequently by several users/programs.178 179 ## Advanced `mode`180 181-By default, **Typer** will configure the <a href="https://docs.python.org/3/library/functions.html#open" class="external-link" target="_blank">`mode`</a> for you:181+By default, **Typer** will configure the [`mode`](https://docs.python.org/3/library/functions.html#open) for you:182 183 * `typer.FileText`: `mode="r"`, to read text.184 * `typer.FileTextWrite`: `mode="w"`, to write text.185 * `typer.FileBinaryRead`: `mode="rb"`, to read binary data.49 unmodified linesmodified:docs/tutorial/parameter-types/path.md+1 added-1 removed
1 # Path2 3-You can declare a *CLI parameter* to be a standard Python <a href="https://docs.python.org/3/library/pathlib.html#basic-use" class="external-link" target="_blank">`pathlib.Path`</a>.3+You can declare a *CLI parameter* to be a standard Python [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html#basic-use).4 5 This is what you would do for directory paths, file paths, etc:6 7 {* docs_src/parameter_types/path/tutorial001_an_py310.py hl[1,10] *}99 unmodified linesmodified:docs/tutorial/parameter-types/uuid.md+2 added-2 removed
1 # UUID2 3 /// note4 5-A UUID is a <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier" class="external-link" target="_blank">"Universally Unique Identifier"</a>.5+A UUID is a ["Universally Unique Identifier"](https://en.wikipedia.org/wiki/Universally_unique_identifier).6 7 It's a standard format for identifiers, like passport numbers, but for anything, not just people in countries.8 9 They look like this:13 unmodified lines23 You can declare a *CLI parameter* as a UUID:24 25 {* docs_src/parameter_types/uuid/tutorial001_py310.py hl[1,9:11] *}26 27-Your Python code will receive a standard Python <a href="https://docs.python.org/3.8/library/uuid.html" class="external-link" target="_blank">`UUID`</a> object with all its attributes and methods, and as you are annotating your function parameter with that type, you will have type checks, autocompletion in your editor, etc.27+Your Python code will receive a standard Python [`UUID`](https://docs.python.org/3.8/library/uuid.html) object with all its attributes and methods, and as you are annotating your function parameter with that type, you will have type checks, autocompletion in your editor, etc.28 29 Check it:30 31 <div class="termy">18 unmodified linesmodified:docs/tutorial/subcommands/callback-override.md+1 added-1 removed
47 unmodified lines48 ## Overriding the callback on creation49 50 If a callback was added when creating the `typer.Typer()` app, it's possible to override it with a new one using `@app.callback()`.51 52-This is the same information you saw on the section about [Commands - Typer Callback](../commands/callback.md){.internal-link target=_blank}, and it applies the same for sub-Typer apps:52+This is the same information you saw on the section about [Commands - Typer Callback](../commands/callback.md), and it applies the same for sub-Typer apps:53 54 {* docs_src/subcommands/callback_override/tutorial003_py310.py hl[6,7,10,14,15,16] *}55 56 Here we had defined a callback when creating the `typer.Typer()` sub-app, but then we override it with a new callback with the function `user_callback()`.42 unmodified linesmodified:docs/tutorial/subcommands/index.md+1 added-1 removed
1 # SubCommands - Command Groups2 3-You read before how to create a program with [Commands](../commands/index.md){.internal-link target=_blank}.3+You read before how to create a program with [Commands](../commands/index.md).4 5 Now we'll see how to create a *CLI program* with commands that have their own subcommands. Also known as command groups.6 7 For example, the *CLI program* `git` has a command `remote`.34 unmodified linesmodified:docs/tutorial/app-dir.md+1 added-1 removed
30 unmodified lines31 If the first element is a `Path` object the next ones (after the `/`) can be `str`.32 33 And it will create a new `Path` object from that.34 35-If you want a quick guide on using `Path()` you can check <a href="https://realpython.com/python-pathlib/" class="external-link" target="_blank">this post on Real Python</a> or <a href="https://treyhunner.com/2018/12/why-you-should-be-using-pathlib/" class="external-link" target="_blank">this post by Trey Hunner</a>.35+If you want a quick guide on using `Path()` you can check [this post on Real Python](https://realpython.com/python-pathlib/) or [this post by Trey Hunner](https://treyhunner.com/2018/12/why-you-should-be-using-pathlib/).36 37 In the code above, we are also explicitly declaring `config_path` as having type `Path` to help the editor provide completion and type checks:38 39 ```Python4 unmodified linesmodified:docs/tutorial/index.md+2 added-2 removed
6 unmodified lines7 You could consider this a **book**, a **course**, the **official** and recommended way to learn **Typer**. 😎8 9 ## Python Types10 11-If you need a refresher about how to use Python type hints, check the first part of <a href="https://fastapi.tiangolo.com/python-types/" class="external-link" target="_blank">FastAPI's Python types intro</a>.11+If you need a refresher about how to use Python type hints, check the first part of [FastAPI's Python types intro](https://fastapi.tiangolo.com/python-types/).12 13-You can also check the <a href="https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html" class="external-link" target="_blank">mypy cheat sheet</a>.13+You can also check the [mypy cheat sheet](https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html).14 15 In short (very short), you can declare a function with parameters like:16 17 ```Python47 unmodified linesmodified:docs/tutorial/install.md+1 added-1 removed
1 # Install **Typer**2 3 The first step is to install **Typer**.4 5-First, make sure you create your [virtual environment](../virtual-environments.md){.internal-link target=_blank}, activate it, and then install it, for example with:5+First, make sure you create your [virtual environment](../virtual-environments.md), activate it, and then install it, for example with:6 7 <div class="termy">8 9 ```console8 unmodified linesmodified:docs/tutorial/options-autocompletion.md+4 added-4 removed
46 unmodified lines47 ## Custom completion for values48 49 Right now we get completion for the *CLI option* names, but not for the values.50 51-We can provide completion for the values creating an `autocompletion` function, similar to the `callback` functions from [CLI Option Callback and Context](./options/callback-and-context.md){.internal-link target=_blank}:51+We can provide completion for the values creating an `autocompletion` function, similar to the `callback` functions from [CLI Option Callback and Context](./options/callback-and-context.md):52 53 {* docs_src/options_autocompletion/tutorial002_an_py310.py hl[6:7,16] *}54 55 We return a `list` of strings from the `complete_name()` function.98 unmodified lines154 ## Simplify with `yield`155 156 Instead of creating and returning a list with values (`str` or `tuple`), we can use `yield` with each value that we want in the completion.157 158-That way our function will be a <a href="https://docs.python.org/3.8/glossary.html#index-19" class="external-link" target="_blank">generator</a> that **Typer** can iterate:158+That way our function will be a [generator](https://docs.python.org/3.8/glossary.html#index-19) that **Typer** can iterate:159 160 {* docs_src/options_autocompletion/tutorial005_an_py310.py hl[12:15] *}161 162 That simplifies our code a bit and works the same.7 unmodified lines170 ///171 172 /// note173 174-The function can use `yield`, so it doesn't have to return strictly a `list`, it just has to be <a href="https://docs.python.org/3.8/glossary.html#term-iterable" class="external-link" target="_blank">iterable</a>.174+The function can use `yield`, so it doesn't have to return strictly a `list`, it just has to be [iterable](https://docs.python.org/3.8/glossary.html#term-iterable).175 176 But each of the elements for completion has to be a `str` or a `tuple` (when containing a help text).177 178 ///104 unmodified lines283 ### Printing to "standard error"284 285 /// tip286 287-If you need a refresher about what is "standard output" and "standard error" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](./printing.md#standard-output-and-standard-error){.internal-link target=_blank}.287+If you need a refresher about what is "standard output" and "standard error" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](./printing.md#standard-output-and-standard-error).288 289 ///290 291 The completion system only reads from "standard output", so, printing to "standard error" won't break completion. 🚀93 unmodified linesmodified:docs/tutorial/package.md+10 added-10 removed
18 unmodified lines19 ///20 21 ## Prerequisites22 23-For this guide we'll use <a href="https://docs.astral.sh/uv/" class="external-link" target="_blank">uv</a>.23+For this guide we'll use [uv](https://docs.astral.sh/uv/).24 25 uv's docs are great, so go ahead, check them and install it.26 27 ## Create a project292 unmodified lines320 ///321 322 /// tip323 324-Bonus points if you use <a href="https://docs.astral.sh/uv/" class="external-link" target="_blank">uvx</a> to install it while keeping an isolated environment for your Python CLI programs 🚀324+Bonus points if you use [uvx](https://docs.astral.sh/uv/) to install it while keeping an isolated environment for your Python CLI programs 🚀325 326 ///327 328 Now you have your CLI program installed. And you can use it freely:156 unmodified lines485 But you can still support `python -m` for the cases where it's useful.486 487 ## Publish to PyPI (optional)488 489-You can publish that new package to <a href="https://pypi.org/" class="external-link" target="_blank">PyPI</a> to make it public, so others can install it easily.489+You can publish that new package to [PyPI](https://pypi.org/) to make it public, so others can install it easily.490 491 So, go ahead and create an account there (it's free).492 493 ### PyPI API token494 495 To do it, you first need to configure a PyPI auth token.496 497-Login to <a href="https://pypi.org/" class="external-link" target="_blank">PyPI</a>.497+Login to [PyPI](https://pypi.org/).498 499-And then go to <a href="https://pypi.org/manage/account/token/" class="external-link" target="_blank">https://pypi.org/manage/account/token/</a> to create a new token.499+And then go to [https://pypi.org/manage/account/token/](https://pypi.org/manage/account/token/) to create a new token.500 501 Let's say your new API token is:502 503 ```26 unmodified lines530 ```531 532 </div>533 534-Now you can go to PyPI and check your projects at <a href="https://pypi.org/manage/projects/" class="external-link" target="_blank">https://pypi.org/manage/projects/</a>.534+Now you can go to PyPI and check your projects at [https://pypi.org/manage/projects/](https://pypi.org/manage/projects/).535 536 You should now see your new "rick-portal-gun" package.537 538 ### Install from PyPI119 unmodified lines658 ## What's next659 660 This is a very simple guide. You could add many more steps.661 662-For example, you should use <a href="https://git-scm.com/" class="external-link" target="_blank">Git</a>, the version control system, to save your code.662+For example, you should use [Git](https://git-scm.com/), the version control system, to save your code.663 664-You could use <a href="https://docs.astral.sh/uv/" class="external-link" target="_blank">uv</a> to manage your installed CLI Python programs in isolated environments.664+You could use [uv](https://docs.astral.sh/uv/) to manage your installed CLI Python programs in isolated environments.665 666-Maybe use automatic formatting with <a href="https://docs.astral.sh/ruff/" class="external-link" target="_blank">Ruff</a>.666+Maybe use automatic formatting with [Ruff](https://docs.astral.sh/ruff/).667 668-You'll probably want to publish your code as open source to <a href="https://github.com/" class="external-link" target="_blank">GitHub</a>.668+You'll probably want to publish your code as open source to [GitHub](https://github.com/).669 670 And then you could integrate a <abbr title="Continuous Integration">CI</abbr> tool to run your tests and deploy your package automatically.671 672 And there's a long etc. But now you have the basics and you can continue on your own. 🚀modified:docs/tutorial/printing.md+9 added-9 removed
16 unmodified lines17 </div>18 19 ## Use Rich20 21-You can also display beautiful and more complex information using <a href="https://rich.readthedocs.io/" class="external-link" target="_blank">Rich</a>. It comes by default when you install `typer`.21+You can also display beautiful and more complex information using [Rich](https://rich.readthedocs.io/). It comes by default when you install `typer`.22 23 ### Use Rich `print`24 25 For the simplest cases, you can just import `print` from `rich` and use it instead of the standard `print`:23 unmodified lines49 </div>50 51 ### Rich Markup52 53-Rich also supports a <a href="https://rich.readthedocs.io/en/stable/markup.html" class="external-link" target="_blank">custom markup syntax</a> to set colors and styles, for example:53+Rich also supports a [custom markup syntax](https://rich.readthedocs.io/en/stable/markup.html) to set colors and styles, for example:54 55 {* docs_src/printing/tutorial002_py310.py hl[9] *}56 57 <div class="termy">7 unmodified lines65 </div>66 67 In this example you can see how to use font styles, colors, and even emojis.68 69-To learn more check out the <a href="https://rich.readthedocs.io/en/stable/markup.html" class="external-link" target="_blank">Rich docs</a>.69+To learn more check out the [Rich docs](https://rich.readthedocs.io/en/stable/markup.html).70 71 ### Rich Tables72 73 The way Rich works internally is that it uses a `Console` object to display the information.24 unmodified lines98 </div>99 100 Rich has many other features, as an example, you can check the docs for:101 102-* <a href="https://rich.readthedocs.io/en/stable/prompt.html" class="external-link" target="_blank">Prompt</a>103-* <a href="https://rich.readthedocs.io/en/stable/markdown.html" class="external-link" target="_blank">Markdown</a>104-* <a href="https://rich.readthedocs.io/en/stable/panel.html" class="external-link" target="_blank">Panel</a>102+* [Prompt](https://rich.readthedocs.io/en/stable/prompt.html)103+* [Markdown](https://rich.readthedocs.io/en/stable/markdown.html)104+* [Panel](https://rich.readthedocs.io/en/stable/panel.html)105 * ...and more.106 107 ### Typer and Rich108 72 unmodified lines181 ## Typer Echo182 183 /// warning184 185-In most of the cases, for displaying advanced information, it is recommended to use <a href="https://rich.readthedocs.io/" class="external-link" target="_blank">Rich</a>.185+In most of the cases, for displaying advanced information, it is recommended to use [Rich](https://rich.readthedocs.io/).186 187 You can probably skip the rest of this section. 🎉😎188 189 ///25 unmodified lines215 ///216 217 /// tip218 219-Again, you are much better off using <a href="https://rich.readthedocs.io/" class="external-link" target="_blank">Rich</a> for this. 😎219+Again, you are much better off using [Rich](https://rich.readthedocs.io/) for this. 😎220 221 ///222 223 You can create colored strings to output to the terminal with `typer.style()`, that gives you `str`s that you can then pass to `typer.echo()`:31 unmodified lines255 ### `typer.secho()` - style and print256 257 /// tip258 259-In case you didn't see above, you are much better off using <a href="https://rich.readthedocs.io/" class="external-link" target="_blank">Rich</a> for this. 😎259+In case you didn't see above, you are much better off using [Rich](https://rich.readthedocs.io/) for this. 😎260 261 ///262 263 There's a shorter form to style and print at the same time with `typer.secho()` it's like `typer.echo()` but also adds style like `typer.style()`:9 unmodified linesmodified:docs/tutorial/progressbar.md+6 added-6 removed
2 unmodified lines3 If you are executing an operation that can take some time, you can inform it to the user. 🤓4 5 ## Progress Bar6 7-You can use <a href="https://rich.readthedocs.io/en/stable/progress.html" class="external-link" target="_blank">Rich's Progress Display</a> to show a progress bar, for example:7+You can use [Rich's Progress Display](https://rich.readthedocs.io/en/stable/progress.html) to show a progress bar, for example:8 9 {* docs_src/progressbar/tutorial001_py310.py hl[4,12] *}10 11 You put the thing that you want to iterate over inside of Rich's `track()`, and then iterate over that.50 unmodified lines62 ```63 64 </div>65 66-You can learn more about it in the <a href="https://rich.readthedocs.io/en/stable/progress.html" class="external-link" target="_blank">Rich docs for Progress Display</a>.66+You can learn more about it in the [Rich docs for Progress Display](https://rich.readthedocs.io/en/stable/progress.html).67 68 ## Typer `progressbar`69 70 If you can, you should use **Rich** as explained above, it has more features, it's more advanced, and can display information more beautifully. ✨9 unmodified lines80 ### Use `typer.progressbar`81 82 /// tip83 84-Remember, you are much better off using <a href="https://rich.readthedocs.io/" class="external-link" target="_blank">Rich</a> for this. 😎84+Remember, you are much better off using [Rich](https://rich.readthedocs.io/) for this. 😎85 86 ///87 88 You can use `typer.progressbar()` with a `with` statement, as in:59 unmodified lines148 ### Setting a Progress Bar `length`149 150 /// tip151 152-Remember, you are much better off using <a href="https://rich.readthedocs.io/" class="external-link" target="_blank">Rich</a> for this. 😎152+Remember, you are much better off using [Rich](https://rich.readthedocs.io/) for this. 😎153 154 ///155 156 The progress bar is generated from the length of the iterable (e.g. the list of users).17 unmodified lines174 </div>175 176 #### About the function with `yield`177 178-If you hadn't seen something like that `yield` above, that's a "<a href="https://docs.python.org/3/glossary.html#term-generator" class="external-link" target="_blank">generator</a>".178+If you hadn't seen something like that `yield` above, that's a "[generator](https://docs.python.org/3/glossary.html#term-generator)".179 180 You can iterate over that function with a `for` and at each iteration it will give you the value at `yield`.181 182 `yield` is like a `return` that gives values multiple times and let's you use the function in a `for` loop.15 unmodified lines198 ### Add a `label`199 200 /// tip201 202-Remember, you are much better off using <a href="https://rich.readthedocs.io/" class="external-link" target="_blank">Rich</a> for this. 😎202+Remember, you are much better off using [Rich](https://rich.readthedocs.io/) for this. 😎203 204 ///205 206 You can also set a `label`:26 unmodified linesmodified:docs/tutorial/prompt.md+2 added-2 removed
1 # Ask with Prompt2 3-When you need to ask the user for info interactively you should normally use [*CLI Option*s with Prompt](options/prompt.md){.internal-link target=_blank}, because they allow using the CLI program in a non-interactive way (for example, a Bash script could use it).3+When you need to ask the user for info interactively you should normally use [*CLI Option*s with Prompt](options/prompt.md), because they allow using the CLI program in a non-interactive way (for example, a Bash script could use it).4 5 But if you absolutely need to ask for interactive information without using a *CLI option*, you can use `typer.prompt()`:6 7 {* docs_src/prompt/tutorial001_py310.py hl[8] *}13 unmodified lines21 </div>22 23 ## Confirm24 25-There's also an alternative to ask for confirmation. Again, if possible, you should use a [*CLI Option* with a confirmation prompt](options/prompt.md){.internal-link target=_blank}:25+There's also an alternative to ask for confirmation. Again, if possible, you should use a [*CLI Option* with a confirmation prompt](options/prompt.md):26 27 {* docs_src/prompt/tutorial002_py310.py hl[8] *}28 29 Check it:65 unmodified linesmodified:docs/tutorial/testing.md+3 added-3 removed
1 # Testing2 3-Testing **Typer** applications is very easy with <a href="https://docs.pytest.org/en/latest/" class="external-link" target="_blank">pytest</a>.3+Testing **Typer** applications is very easy with [pytest](https://docs.pytest.org/en/latest/).4 5 Let's say you have an application `app/main.py` with:6 7 {* docs_src/testing/app01_py310/main.py *}68 unmodified lines76 ///77 78 /// note79 80-If you need a refresher about what is "standard output" and "standard error" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](printing.md#standard-output-and-standard-error){.internal-link target=_blank}.80+If you need a refresher about what is "standard output" and "standard error" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](printing.md#standard-output-and-standard-error).81 82 ///83 84 ### Call `pytest`45 unmodified lines130 This is because what you type in the terminal goes to "**standard input**" and is handled by the operating system as if it was a "virtual file".131 132 /// note133 134-If you need a refresher about what is "standard output", "standard error", and "standard input" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](printing.md#standard-output-and-standard-error){.internal-link target=_blank}.134+If you need a refresher about what is "standard output", "standard error", and "standard input" check the section in [Printing and Colors: "Standard Output" and "Standard Error"](printing.md#standard-output-and-standard-error).135 136 ///137 138 When you hit the <kbd>ENTER</kbd> key after typing the email, that is just a "new line character". And in Python that is represented with `"\n"`.76 unmodified linesmodified:docs/tutorial/typer-app.md+2 added-2 removed
27 unmodified lines28 29 A "decorator" takes the function below and does something with it.30 31 In our case, this decorator tells **Typer** that the function below is a "`command`".32-You will learn more about commands later in the section [commands](./commands/index.md){.internal-link target=_blank}.32+You will learn more about commands later in the section [commands](./commands/index.md).33 34 ///35 36 Both ways, with `typer.run()` and creating the explicit application, achieve almost the same.75 unmodified lines112 Having a standalone program like that allows setting up shell/tab completion.113 114 The first step to be able to create an installable package like that is to use an explicit `typer.Typer()` app.115 116-Later you can learn all the process to create a standalone CLI application and [Build a Package](./package.md){.internal-link target=_blank}.116+Later you can learn all the process to create a standalone CLI application and [Build a Package](./package.md).117 118 But for now, it's just good to know that you are on that path. 😎modified:docs/alternatives.md+9 added-9 removed
8 unmodified lines9 There have been many tools created before that have helped inspire its creation.10 11 ## Previous tools12 13-### <a href="https://docs.python.org/3/library/argparse.html" class="external-link" target="_blank">`argparse`</a>13+### [`argparse`](https://docs.python.org/3/library/argparse.html)14 15 `argparse` is the Python standard library's module to write CLIs.16 17 It provides a better alternative than reading the *CLI Parameters* as a `list` of `str` and parsing everything by hand.3 unmodified lines21 Provide a better development experience than just reading *CLI Parameters* by hand.22 23 ///24 25-### <a href="https://hugapi.github.io/hug/" class="external-link" target="_blank">Hug</a>25+### [Hug](https://hugapi.github.io/hug/)26 27 Hug is a library to create APIs and CLIs, it uses parameters in functions to declare the required data.28 29 It inspired a lot of the ideas in **FastAPI** and **Typer**.3 unmodified lines33 Use function parameters to declare *CLI arguments* and *CLI options* as it simplifies a lot the development experience.34 35 ///36 37-### <a href="https://plac.readthedocs.io/en/latest/" class="external-link" target="_blank">Plac</a>37+### [Plac](https://plac.readthedocs.io/en/latest/)38 39 Plac is another library to create CLIs using parameters in functions, similar to Hug.40 41 /// tip | Inspired **Typer** to1 unmodified line43 Provide a simple way to use a function as a command line app, without having to create a complete app, with `typer.run(some_function)`.44 45 ///46 47-### <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a>47+### [Pydantic](https://pydantic-docs.helpmanual.io/)48 49 Pydantic is a library to handle data validation using standard modern Python type annotations.50 51 It powers **FastAPI** underneath.5 unmodified lines57 Use standard Python type annotations to declare types instead of library-specific types or classes and use them for data validation and documentation.58 59 ///60 61-### <a href="https://click.palletsprojects.com" class="external-link" target="_blank">Click</a>61+### [Click](https://click.palletsprojects.com)62 63 Click is one of the most widely used libraries to create CLIs in Python.64 65 It's a very powerful tool and there are many CLIs built with it. It is what powers **Typer** underneath.9 unmodified lines75 Everything. 🚀76 77 **Typer** mainly adds a layer on top of Click, making the code simpler and easier to use, with autocompletion everywhere, etc, but providing all the powerful features of Click underneath.78 79-As someone pointed out: <em><a href="https://twitter.com/fishnets88/status/1210126833745838080" class="external-link" target="_blank">"Nice to see it is built on Click but adds the type stuff. Me gusta!"</a></em>79+As someone pointed out: <em>["Nice to see it is built on Click but adds the type stuff. Me gusta!"](https://twitter.com/fishnets88/status/1210126833745838080)</em>80 81 ///82 83-### <a href="https://github.com/click-contrib/click-completion" class="external-link" target="_blank">`click-completion`</a>83+### [`click-completion`](https://github.com/click-contrib/click-completion)84 85 `click-completion` is a plug-in for Click. It was created to extend completion support for shells when Click only had support for Bash completion.86 87 Previous versions of **Typer** had deep integrations with `click-completion` and used it as an optional dependency. But now all the completion logic is implemented internally in **Typer** itself, the internal logic was heavily inspired and using some parts of `click-completion`.5 unmodified lines93 Provide auto completion for all the shells.94 95 ///96 97-### <a href="https://fastapi.tiangolo.com/" class="external-link" target="_blank">FastAPI</a>97+### [FastAPI](https://fastapi.tiangolo.com/)98 99-I created **FastAPI** to provide an easy way to build APIs with autocompletion for everything in the code (and some other <a href="https://fastapi.tiangolo.com/features/" class="external-link" target="_blank">features</a>).99+I created **FastAPI** to provide an easy way to build APIs with autocompletion for everything in the code (and some other [features](https://fastapi.tiangolo.com/features/)).100 101 **Typer** is the "FastAPI of CLIs".102 103 It uses the same design and usage of FastAPI as much as possible. So, if you have used FastAPI, you know how to use Typer.modified:docs/contributing.md+5 added-5 removed
1 # Development - Contributing2 3-First, you might want to see the basic ways to [help Typer and get help](help-typer.md){.internal-link target=_blank}.3+First, you might want to see the basic ways to [help Typer and get help](help-typer.md).4 5 ## Developing6 7-If you already cloned the <a href="https://github.com/fastapi/typer" class="external-link" target="_blank">typer repository</a> and you want to deep dive in the code, here are some guidelines to set up your environment.7+If you already cloned the [typer repository](https://github.com/fastapi/typer) and you want to deep dive in the code, here are some guidelines to set up your environment.8 9 ### Install Requirements Using `uv`10 11 Create a virtual environment and install the required packages in one command:240 unmodified lines252 #### Typer CLI (optional)253 254 The instructions here show you how to use the script at `./scripts/docs.py` with the `python` program directly.255 256-But you can also use <a href="https://typer.tiangolo.com/typer-cli/" class="external-link" target="_blank">Typer CLI</a>, and you will get autocompletion in your terminal for the commands after installing completion.256+But you can also use [Typer CLI](https://typer.tiangolo.com/typer-cli/), and you will get autocompletion in your terminal for the commands after installing completion.257 258 If you install Typer CLI, you can install completion with:259 260 <div class="termy">8 unmodified lines269 </div>270 271 ### Docs Structure272 273-The documentation uses <a href="https://zensical.org" class="external-link" target="_blank">Zensical</a>.273+The documentation uses [Zensical](https://zensical.org).274 275 And there are extra tools/scripts in place in `./scripts/docs.py`.276 277 /// tip37 unmodified lines315 The same applies to comments and descriptions, please don't copy paste the content generated by an LLM.316 317 ### Human Effort Denial of Service318 319-Using automated tools and AI to submit PRs or comments that we have to carefully review and handle would be the equivalent of a <a href="https://en.wikipedia.org/wiki/Denial-of-service_attack" class="external-link" target="_blank">Denial-of-service attack</a> on our human effort.319+Using automated tools and AI to submit PRs or comments that we have to carefully review and handle would be the equivalent of a [Denial-of-service attack](https://en.wikipedia.org/wiki/Denial-of-service_attack) on our human effort.320 321 It would be very little effort from the person submitting the PR (an LLM prompt) that generates a large amount of effort on our side (carefully reviewing code).322 323 Please don't do that.14 unmodified linesmodified:docs/environment-variables.md+5 added-5 removed
65 unmodified lines66 ```67 68 /// tip69 70-The second argument to <a href="https://docs.python.org/3.8/library/os.html#os.getenv" class="external-link" target="_blank">`os.getenv()`</a> is the default value to return.70+The second argument to [`os.getenv()`](https://docs.python.org/3.8/library/os.html#os.getenv) is the default value to return.71 72 If not provided, it's `None` by default, here we provide `"World"` as the default value to use.73 74 ///79 unmodified lines154 </div>155 156 /// tip157 158-You can read more about it at <a href="https://12factor.net/config" class="external-link" target="_blank">The Twelve-Factor App: Config</a>.158+You can read more about it at [The Twelve-Factor App: Config](https://12factor.net/config).159 160 ///161 162 ## Types and Validation1 unmodified line164 These environment variables can only handle **text strings**, as they are external to Python and have to be compatible with other programs and the rest of the system (and even with different operating systems, as Linux, Windows, macOS).165 166 That means that **any value** read in Python from an environment variable **will be a `str`**, and any conversion to a different type or any validation has to be done in code.167 168-You will learn more about using environment variables for your <abbr title="command line interface">CLI</abbr> applications later in the section about [CLI Arguments with Environment Variables](./tutorial/arguments/envvar.md){.internal-link target=_blank}.168+You will learn more about using environment variables for your <abbr title="command line interface">CLI</abbr> applications later in the section about [CLI Arguments with Environment Variables](./tutorial/arguments/envvar.md).169 170 ## `PATH` Environment Variable171 172 There is a **special** environment variable called **`PATH`** that is used by the operating systems (Linux, macOS, Windows) to find programs to run.109 unmodified lines282 </div>283 284 ////285 286-This information will be useful when learning about [Virtual Environments](virtual-environments.md){.internal-link target=_blank}.286+This information will be useful when learning about [Virtual Environments](virtual-environments.md).287 288 It will also be useful when you **create your own CLI programs** as, for them to be available for your users, they will need to be somewhere in the `PATH` environment variable.289 290 ## Conclusion291 292 With this you should have a basic understanding of what **environment variables** are and how to use them in Python.293 294-You can also read more about them in the <a href="https://en.wikipedia.org/wiki/Environment_variable" class="external-link" target="_blank">Wikipedia for Environment Variable</a>.294+You can also read more about them in the [Wikipedia for Environment Variable](https://en.wikipedia.org/wiki/Environment_variable).295 296 In many cases it's not very obvious how environment variables would be useful and applicable right away. But they keep showing up in many different scenarios when you are developing, so it's good to know about them.297 298 For example, you will need this information in the next section, about [Virtual Environments](virtual-environments.md).modified:docs/features.md+6 added-6 removed
1 # Features2 3 ## Design based on **FastAPI**4 5-<a href="https://fastapi.tiangolo.com" target="_blank"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" style="width: 20%;"></a>5+<a href="https://fastapi.tiangolo.com"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" style="width: 20%;"></a>6 7-**Typer** is <a href="https://fastapi.tiangolo.com" class="external-link" target="_blank">FastAPI</a>'s little sibling.7+**Typer** is [FastAPI](https://fastapi.tiangolo.com)'s little sibling.8 9 It follows the same design and ideas. If you know **FastAPI**, you already know **Typer**... more or less.10 11 ## Just Modern Python12 13 It's all based on standard **Python type** declarations. No new syntax to learn. Just standard modern Python.14 15-If you need a 2 minute refresher of how to use Python types (even if you don't use FastAPI or Typer), check the FastAPI tutorial section: <a href="https://fastapi.tiangolo.com/python-types/" class="external-link" target="_blank">Python types intro</a>.15+If you need a 2 minute refresher of how to use Python types (even if you don't use FastAPI or Typer), check the FastAPI tutorial section: [Python types intro](https://fastapi.tiangolo.com/python-types/).16 17-You will also see a 20 seconds refresher on the section [Tutorial - User Guide: First Steps](tutorial/first-steps.md){.internal-link target=_blank}.17+You will also see a 20 seconds refresher on the section [Tutorial - User Guide: First Steps](tutorial/first-steps.md).18 19 ## Editor support20 21 **Typer** was designed to be easy and intuitive to use, to ensure the best development experience. With autocompletion everywhere.1 unmodified line23 You will rarely need to come back to the docs.24 25 Here's how your editor might help you:26 27-* in <a href="https://code.visualstudio.com/" class="external-link" target="_blank">Visual Studio Code</a>:27+* in [Visual Studio Code](https://code.visualstudio.com/):28 29 30 31-* in <a href="https://www.jetbrains.com/pycharm/" class="external-link" target="_blank">PyCharm</a>:31+* in [PyCharm](https://www.jetbrains.com/pycharm/):32 33 34 35 You will get completion for everything. That's something no other CLI library provides right now.43 unmodified linesmodified:docs/help-typer.md+21 added-21 removed
10 unmodified lines11 And there are several ways to get help too.12 13 ## Subscribe to the newsletter14 15-You can subscribe to the (infrequent) [**FastAPI and friends** newsletter](https://fastapi.tiangolo.com/newsletter/){.internal-link target=_blank} to stay updated about:15+You can subscribe to the (infrequent) [**FastAPI and friends** newsletter](https://fastapi.tiangolo.com/newsletter/) to stay updated about:16 17 * News about FastAPI and friends, including Typer 🚀18 * Guides 📝19 * Features ✨1 unmodified line21 * Tips and tricks ✅22 23 ## Star **Typer** in GitHub24 25-You can "star" Typer in GitHub (clicking the star button at the top right): <a href="https://github.com/fastapi/typer" class="external-link" target="_blank">https://github.com/fastapi/typer</a>.25+You can "star" Typer in GitHub (clicking the star button at the top right): [https://github.com/fastapi/typer](https://github.com/fastapi/typer).26 27 By adding a star, other users will be able to find it more easily and see that it has been already useful for others.28 29 ## Watch the GitHub repository for releases30 31-You can "watch" Typer in GitHub (clicking the "watch" button at the top right): <a href="https://github.com/fastapi/typer" class="external-link" target="_blank">https://github.com/fastapi/typer</a>.31+You can "watch" Typer in GitHub (clicking the "watch" button at the top right): [https://github.com/fastapi/typer](https://github.com/fastapi/typer).32 33 There you can select "Releases only".34 35 By doing it, you will receive notifications (in your email) whenever there's a new release (a new version) of **Typer** with bug fixes and new features.36 37 ## Connect with the author38 39-You can connect with <a href="https://tiangolo.com" class="external-link" target="_blank">me (Sebastián Ramírez / `tiangolo`)</a>, the author.39+You can connect with [me (Sebastián Ramírez / `tiangolo`)](https://tiangolo.com), the author.40 41 You can:42 43-* <a href="https://github.com/tiangolo" class="external-link" target="_blank">Follow me on **GitHub**</a>.43+* [Follow me on **GitHub**](https://github.com/tiangolo).44 * See other Open Source projects I have created that could help you.45 * Follow me to see when I create a new Open Source project.46-* <a href="https://twitter.com/tiangolo" class="external-link" target="_blank">Follow me on **Twitter**</a>.46+* [Follow me on **Twitter**](https://twitter.com/tiangolo).47 * Tell me how you use Typer (I love to hear that).48 * Hear when I make announcements or release new tools.49-* <a href="https://www.linkedin.com/in/tiangolo/" class="external-link" target="_blank">Connect with me on **Linkedin**</a>.49+* [Connect with me on **Linkedin**](https://www.linkedin.com/in/tiangolo/).50 * Hear when I make announcements or release new tools (although I use Twitter more often 🤷♂).51-* Read what I write (or follow me) on <a href="https://dev.to/tiangolo" class="external-link" target="_blank">**Dev.to**</a> or <a href="https://medium.com/@tiangolo" class="external-link" target="_blank">**Medium**</a>.51+* Read what I write (or follow me) on [**Dev.to**](https://dev.to/tiangolo) or [**Medium**](https://medium.com/@tiangolo).52 * Read other ideas, articles, and read about tools I have created.53 * Follow me to read when I publish something new.54 55 ## Tweet about **Typer**56 57-<a href="https://twitter.com/compose/tweet?text=I'm loving Typer because... https://github.com/fastapi/typer cc @tiangolo" class="external-link" target="_blank">Tweet about **Typer**</a> and let me and others know why you like it.57+[Tweet about **Typer**](https://twitter.com/compose/tweet?text=I'm loving Typer because... https://github.com/fastapi/typer cc @tiangolo) and let me and others know why you like it.58 59 I love to hear about how **Typer** is being used, what have you liked in it, in which project/company you are using it, etc.60 61 ## Help others with questions in GitHub62 63 You can try and help others with their questions in:64 65-* <a href="https://github.com/fastapi/typer/discussions/categories/questions?discussions_q=category%3AQuestions+is%3Aunanswered" class="external-link" target="_blank">GitHub Discussions</a>66-* <a href="https://github.com/fastapi/typer/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Aquestion+-label%3Aanswered+" class="external-link" target="_blank">GitHub Issues</a>65+* [GitHub Discussions](https://github.com/fastapi/typer/discussions/categories/questions?discussions_q=category%3AQuestions+is%3Aunanswered)66+* [GitHub Issues](https://github.com/fastapi/typer/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Aquestion+-label%3Aanswered+)67 68 In many cases you might already know the answer for those questions. 🤓69 70 Just remember, the most important point is: try to be kind. People come with their frustrations and in many cases don't ask in the best way, but try as best as you can to be kind. 🤗19 unmodified lines90 For most of the cases and most of the questions there's something related to the person's **original code**.91 92 In many cases they will only copy a fragment of the code, but that's not enough to **reproduce the problem**.93 94-* You can ask them to provide a <a href="https://stackoverflow.com/help/minimal-reproducible-example" class="external-link" target="_blank">minimal, reproducible, example</a>, that you can **copy-paste** and run locally to see the same error or behavior they are seeing, or to understand their use case better.94+* You can ask them to provide a [minimal, reproducible, example](https://stackoverflow.com/help/minimal-reproducible-example), that you can **copy-paste** and run locally to see the same error or behavior they are seeing, or to understand their use case better.95 96 * If you are feeling too generous, you can try to **create an example** like that yourself, just based on the description of the problem. Just have in mind that this might take a lot of time and it might be better to ask them to clarify the problem first.97 98 ### Suggest solutions12 unmodified lines111 * In GitHub Issues: **close** the issue**.112 113 ## Watch the GitHub repository114 115-You can "watch" Typer in GitHub (clicking the "watch" button at the top right): <a href="https://github.com/fastapi/typer" class="external-link" target="_blank">https://github.com/fastapi/typer</a>.115+You can "watch" Typer in GitHub (clicking the "watch" button at the top right): [https://github.com/fastapi/typer](https://github.com/fastapi/typer).116 117 If you select "Watching" instead of "Releases only" you will receive notifications when someone creates a new issue or question. You can also specify that you only want to be notified about new issues, or discussions, or PRs, etc.118 119 Then you can try and help them solve those questions.120 121 ## Ask Questions122 123-You can <a href="https://github.com/fastapi/typer/discussions/new?category=questions" class="external-link" target="_blank">create a new question</a> in the GitHub repository, for example to:123+You can [create a new question](https://github.com/fastapi/typer/discussions/new?category=questions) in the GitHub repository, for example to:124 125 * Ask a **question** or ask about a **problem**.126 * Suggest a new **feature**.127 54 unmodified lines182 * Then also comment what you tried, that way I'll know that you checked it. 🤓183 184 ## Create a Pull Request185 186-You can [contribute](contributing.md){.internal-link target=_blank} to the source code with Pull Requests, for example:186+You can [contribute](contributing.md) to the source code with Pull Requests, for example:187 188 * To fix a typo you found on the documentation.189 * To propose new documentation sections.190 * To fix an existing issue/bug.12 unmodified lines203 There's a lot of work to do, and for most of it, **YOU** can do it.204 205 The main tasks that you can do right now are:206 207-* [Help others with questions in GitHub](#help-others-with-questions-in-github){.internal-link target=_blank} (see the section above).208-* [Review Pull Requests](#review-pull-requests){.internal-link target=_blank} (see the section above).207+* [Help others with questions in GitHub](#help-others-with-questions-in-github) (see the section above).208+* [Review Pull Requests](#review-pull-requests) (see the section above).209 210 Those two tasks are what **consume time the most**. That's the main work of maintaining Typer.211 212 If you can help me with that, **you are helping me maintain Typer** and making sure it keeps **advancing faster and better**. 🚀213 214 ## Join the chat215 216-Join the 👥 <a href="https://discord.gg/VQjSZaeJmf" class="external-link" target="_blank">FastAPI and Friends Discord chat server</a> 👥 and hang out with others in the community. There's a `#typer` channel.216+Join the 👥 [FastAPI and Friends Discord chat server](https://discord.gg/VQjSZaeJmf) 👥 and hang out with others in the community. There's a `#typer` channel.217 218 /// tip219 220-For questions, ask them in <a href="https://github.com/fastapi/typer/discussions/new?category=questions" class="external-link" target="_blank">GitHub Discussions</a>, there's a much better chance you will receive help there.220+For questions, ask them in [GitHub Discussions](https://github.com/fastapi/typer/discussions/new?category=questions), there's a much better chance you will receive help there.221 222 Use the chat only for other general conversations.223 224 ///9 unmodified lines234 On the other side, there are thousands of users in the chat, so there's a high chance you'll find someone to talk to there, almost all the time. 😄235 236 ## Sponsor the author237 238-You can also financially support the author (me) through <a href="https://github.com/sponsors/tiangolo" class="external-link" target="_blank">GitHub sponsors</a>.238+You can also financially support the author (me) through [GitHub sponsors](https://github.com/sponsors/tiangolo).239 240 There you could buy me a coffee ☕️ to say thanks. 😄241 242 ## Sponsor the tools that power Typer1 unmodified line244 As you have seen in the documentation, Typer is built on top of Click.245 246 You can also sponsor:247 248-* Pallets Project (Click maintainers) <a href="https://palletsprojects.com/donate" class="external-link" target="_blank">via the PSF</a> or <a href="https://tidelift.com/subscription/pkg/pypi-click" class="external-link" target="_blank">via Tidelift</a>248+* Pallets Project (Click maintainers) [via the PSF](https://palletsprojects.com/donate) or [via Tidelift](https://tidelift.com/subscription/pkg/pypi-click)249 250 ---251 252 Thanks! 🚀modified:docs/index.md+11 added-11 removed
12 unmodified lines13 <p align="center">14 <em>Typer, build great CLIs. Easy to code. Based on Python type hints.</em>15 </p>16 <p align="center">17-<a href="https://github.com/fastapi/typer/actions?query=workflow%3ATest+event%3Apush+branch%3Amaster" target="_blank">17+<a href="https://github.com/fastapi/typer/actions?query=workflow%3ATest+event%3Apush+branch%3Amaster">18 <img src="https://github.com/fastapi/typer/actions/workflows/test.yml/badge.svg?event=push&branch=master" alt="Test">19 </a>20-<a href="https://github.com/fastapi/typer/actions?query=workflow%3APublish" target="_blank">20+<a href="https://github.com/fastapi/typer/actions?query=workflow%3APublish">21 <img src="https://github.com/fastapi/typer/workflows/Publish/badge.svg" alt="Publish">22 </a>23-<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/typer" target="_blank">23+<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/typer">24 <img src="https://coverage-badge.samuelcolvin.workers.dev/fastapi/typer.svg" alt="Coverage">25-<a href="https://pypi.org/project/typer" target="_blank">25+<a href="https://pypi.org/project/typer">26 <img src="https://img.shields.io/pypi/v/typer?color=%2334D058&label=pypi%20package" alt="Package version">27 </a>28 </p>29 30 ---31 32-**Documentation**: <a href="https://typer.tiangolo.com" target="_blank">https://typer.tiangolo.com</a>32+**Documentation**: [https://typer.tiangolo.com](https://typer.tiangolo.com)33 34-**Source Code**: <a href="https://github.com/fastapi/typer" target="_blank">https://github.com/fastapi/typer</a>34+**Source Code**: [https://github.com/fastapi/typer](https://github.com/fastapi/typer)35 36 ---37 38 Typer is a library for building <abbr title="command line interface, programs executed from a terminal">CLI</abbr> applications that users will **love using** and developers will **love creating**. Based on Python type hints.10 unmodified lines49 * **Run scripts**: Typer includes a `typer` command/program that you can use to run scripts, automatically converting them to CLIs, even if they don't use Typer internally.50 51 ## FastAPI of CLIs52 53-**Typer** is <a href="https://fastapi.tiangolo.com" class="external-link" target="_blank">FastAPI</a>'s little sibling, it's the FastAPI of CLIs.53+**Typer** is [FastAPI](https://fastapi.tiangolo.com)'s little sibling, it's the FastAPI of CLIs.54 55 ## Installation56 57-Create and activate a <a href="https://typer.tiangolo.com/virtual-environments/" class="external-link" target="_blank">virtual environment</a> and then install **Typer**:57+Create and activate a [virtual environment](https://typer.tiangolo.com/virtual-environments/) and then install **Typer**:58 59 <div class="termy">60 61 ```console299 unmodified lines361 ## Dependencies362 363 **Typer** stands on the shoulders of giants. It has three required dependencies:364 365-* <a href="https://click.palletsprojects.com/" class="external-link" target="_blank">Click</a>: a popular tool for building CLIs in Python. Typer is based on it.366-* <a href="https://rich.readthedocs.io/en/stable/index.html" class="external-link" target="_blank"><code>rich</code></a>: to show nicely formatted errors automatically.367-* <a href="https://github.com/sarugaku/shellingham" class="external-link" target="_blank"><code>shellingham</code></a>: to automatically detect the current shell when installing completion.365+* [Click](https://click.palletsprojects.com/): a popular tool for building CLIs in Python. Typer is based on it.366+* [`rich`](https://rich.readthedocs.io/en/stable/index.html): to show nicely formatted errors automatically.367+* [`shellingham`](https://github.com/sarugaku/shellingham): to automatically detect the current shell when installing completion.368 369 ### `typer-slim`370 371 There used to be a slimmed-down version of Typer called `typer-slim`, which didn't include the dependencies `rich` and `shellingham`, nor the `typer` command.8 unmodified linesmodified:docs/management-tasks.md+8 added-8 removed
1 # Repository Management Tasks2 3-These are the tasks that can be performed to manage the Typer repository by [team members](./management.md#team){.internal-link target=_blank}.3+These are the tasks that can be performed to manage the Typer repository by [team members](./management.md#team).4 5 /// tip6 7 This section is useful only to a handful of people, team members with permissions to manage the repository. You can probably skip it. 😉8 9 ///10 11-...so, you are a [team member of Typer](./management.md#team){.internal-link target=_blank}? Wow, you are so cool! 😎11+...so, you are a [team member of Typer](./management.md#team)? Wow, you are so cool! 😎12 13-You can help with everything on [Help Typer - Get Help](./help-typer.md){.internal-link target=_blank} the same ways as external contributors. But additionally, there are some tasks that only you (as part of the team) can perform.13+You can help with everything on [Help Typer - Get Help](./help-typer.md) the same ways as external contributors. But additionally, there are some tasks that only you (as part of the team) can perform.14 15 Here are the general instructions for the tasks you can perform.16 17 Thanks a lot for your help. 🙇21 unmodified lines39 For conversations that are more difficult, for example to reject a PR, you can ask me (@tiangolo) to handle it directly.40 41 ## Edit PR Titles42 43-* Edit the PR title to start with an emoji from <a href="https://gitmoji.dev/" class="external-link" target="_blank">gitmoji</a>.43+* Edit the PR title to start with an emoji from [gitmoji](https://gitmoji.dev/).44 * Use the emoji character, not the GitHub code. So, use `🐛` instead of `:bug:`. This is so that it shows up correctly outside of GitHub, for example in the release notes.45 * Start the title with a verb. For example `Add`, `Refactor`, `Fix`, etc. This way the title will say the action that the PR does. Like `Add support for teleporting`, instead of `Teleporting wasn't working, so this PR fixes it`.46 * Edit the text of the PR title to start in "imperative", like giving an order. So, instead of `Adding support for teleporting` use `Add support for teleporting`.47 * Try to make the title descriptive about what it achieves. If it's a feature, try to describe it, for example `Add support for teleporting` instead of `Create TeleportAdapter class`.48 * Do not finish the title with a period (`.`).49 50-Once the PR is merged, a GitHub Action (<a href="https://github.com/tiangolo/latest-changes" class="external-link" target="_blank">latest-changes</a>) will use the PR title to update the latest changes automatically.50+Once the PR is merged, a GitHub Action ([latest-changes](https://github.com/tiangolo/latest-changes)) will use the PR title to update the latest changes automatically.51 52 So, having a nice PR title will not only look nice in GitHub, but also in the release notes. 📝53 54 ## Add Labels to PRs55 56-The same GitHub Action <a href="https://github.com/tiangolo/latest-changes" class="external-link" target="_blank">latest-changes</a> uses one label in the PR to decide the section in the release notes to put this PR in.56+The same GitHub Action [latest-changes](https://github.com/tiangolo/latest-changes) uses one label in the PR to decide the section in the release notes to put this PR in.57 58-Make sure you use a supported label from the <a href="https://github.com/tiangolo/latest-changes#using-labels" class="external-link" target="_blank">latest-changes list of labels</a>:58+Make sure you use a supported label from the [latest-changes list of labels](https://github.com/tiangolo/latest-changes#using-labels):59 60 * `breaking`: Breaking Changes61 * Existing code will break if they update the version without changing their code. This rarely happens, so this label is not frequently used.62 * `security`: Security Fixes50 unmodified lines113 ## Mark GitHub Discussions Answers114 115 When a question in GitHub Discussions has been answered, mark the answer by clicking "Mark as answer".116 117-You can filter discussions by <a href="https://github.com/fastapi/typer/discussions/categories/questions?discussions_q=category:Questions+is:open+is:unanswered" class="external-link" target="_blank">`Questions` that are `Unanswered`</a>.117+You can filter discussions by [`Questions` that are `Unanswered`](https://github.com/fastapi/typer/discussions/categories/questions?discussions_q=category:Questions+is:open+is:unanswered).modified:docs/management.md+5 added-5 removed
7 unmodified lines8 Here's a short description of how the Typer repository is managed and maintained.9 10 ## Owner11 12-I, <a href="https://github.com/tiangolo" target="_blank">@tiangolo</a>, am the creator and owner of the Typer repository. 🤓12+I, [@tiangolo](https://github.com/tiangolo), am the creator and owner of the Typer repository. 🤓13 14-I normally give the final review to each PR before merging them. I make the final decisions on the project, I'm the <a href="https://en.wikipedia.org/wiki/Benevolent_dictator_for_life" class="external-link" target="_blank"><abbr title="Benevolent Dictator For Life">BDFL</abbr></a>. 😅14+I normally give the final review to each PR before merging them. I make the final decisions on the project, I'm the [<abbr title="Benevolent Dictator For Life">BDFL</abbr>](https://en.wikipedia.org/wiki/Benevolent_dictator_for_life). 😅15 16 ## Team17 18 There's a team of people that help manage and maintain the project. 😎19 20-They have different levels of permissions and [specific instructions](./management-tasks.md){.internal-link target=_blank}.20+They have different levels of permissions and [specific instructions](./management-tasks.md).21 22 Some of the tasks they can perform include:23 24 * Adding labels to PRs.10 unmodified lines35 36 <div class="user-list user-list-center">37 {% for user in members %}38 39-<div class="user"><a href="https://github.com/{{ user.login }}" target="_blank"><div class="avatar-wrapper"><img src="https://github.com/{{ user.login }}.png"/></div><div class="title">@{{ user.login }}</div></a></div>39+<div class="user"><a href="https://github.com/{{ user.login }}"><div class="avatar-wrapper"><img src="https://github.com/{{ user.login }}.png"/></div><div class="title">@{{ user.login }}</div></a></div>40 {% endfor %}41 42 </div>43 2 unmodified lines46 ## External Contributions47 48 External contributions are very welcome and appreciated, including answering questions, submitting PRs, etc. 🙇♂️49 50-There are many ways to [help maintain Typer](./help-typer.md){.internal-link target=_blank}.50+There are many ways to [help maintain Typer](./help-typer.md).modified:docs/virtual-environments.md+15 added-15 removed
20 unmodified lines21 /// note22 23 This page will teach you how to use **virtual environments** and how they work.24 25-If you are ready to adopt a **tool that manages everything** for you (including installing Python), try <a href="https://github.com/astral-sh/uv" class="external-link" target="_blank">uv</a>.25+If you are ready to adopt a **tool that manages everything** for you (including installing Python), try [uv](https://github.com/astral-sh/uv).26 27 ///28 29 ## Create a Project55 unmodified lines85 ////86 87 //// tab | `uv`88 89-If you have <a href="https://github.com/astral-sh/uv" class="external-link" target="_blank">`uv`</a> installed, you can use it to create a virtual environment.89+If you have [`uv`](https://github.com/astral-sh/uv) installed, you can use it to create a virtual environment.90 91 <div class="termy">92 93 ```console55 unmodified lines149 ////150 151 //// tab | Windows Bash152 153-Or if you use Bash for Windows (e.g. <a href="https://gitforwindows.org/" class="external-link" target="_blank">Git Bash</a>):153+Or if you use Bash for Windows (e.g. [Git Bash](https://gitforwindows.org/)):154 155 <div class="termy">156 157 ```console57 unmodified lines215 ## Upgrade `pip`216 217 /// tip218 219-If you use <a href="https://github.com/astral-sh/uv" class="external-link" target="_blank">`uv`</a> you would use it to install things instead of `pip`, so you don't need to upgrade `pip`. 😎219+If you use [`uv`](https://github.com/astral-sh/uv) you would use it to install things instead of `pip`, so you don't need to upgrade `pip`. 😎220 221 ///222 223 If you are using `pip` to install packages (it comes by default with Python), you should **upgrade** it to the latest version.23 unmodified lines247 If you are using **Git** (you should), add a `.gitignore` file to exclude everything in your `.venv` from Git.248 249 /// tip250 251-If you used <a href="https://github.com/astral-sh/uv" class="external-link" target="_blank">`uv`</a> to create the virtual environment, it already did this for you, you can skip this step. 😎251+If you used [`uv`](https://github.com/astral-sh/uv) to create the virtual environment, it already did this for you, you can skip this step. 😎252 253 ///254 255 /// tip63 unmodified lines319 ////320 321 //// tab | `uv`322 323-If you have <a href="https://github.com/astral-sh/uv" class="external-link" target="_blank">`uv`</a>:323+If you have [`uv`](https://github.com/astral-sh/uv):324 325 <div class="termy">326 327 ```console23 unmodified lines351 ////352 353 //// tab | `uv`354 355-If you have <a href="https://github.com/astral-sh/uv" class="external-link" target="_blank">`uv`</a>:355+If you have [`uv`](https://github.com/astral-sh/uv):356 357 <div class="termy">358 359 ```console35 unmodified lines395 You would probably use an editor, make sure you configure it to use the same virtual environment you created (it will probably autodetect it) so that you can get autocompletion and inline errors.396 397 For example:398 399-* <a href="https://code.visualstudio.com/docs/python/environments#_select-and-activate-an-environment" class="external-link" target="_blank">VS Code</a>400-* <a href="https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html" class="external-link" target="_blank">PyCharm</a>399+* [VS Code](https://code.visualstudio.com/docs/python/environments#_select-and-activate-an-environment)400+* [PyCharm](https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html)401 402 /// tip403 404 You normally have to do this only **once**, when you create the virtual environment.29 unmodified lines434 ///435 436 ## Why Virtual Environments437 438-To work with Typer you need to install <a href="https://www.python.org/" class="external-link" target="_blank">Python</a>.438+To work with Typer you need to install [Python](https://www.python.org/).439 440 After that, you would need to **install** Typer and any other **packages** you want to use.441 442 To install packages you would normally use the `pip` command that comes with Python (or similar alternatives).100 unmodified lines543 ```544 545 </div>546 547-That will download a compressed file with the Typer code, normally from <a href="https://pypi.org/project/typer/" class="external-link" target="_blank">PyPI</a>.547+That will download a compressed file with the Typer code, normally from [PyPI](https://pypi.org/project/typer/).548 549 It will also **download** files for other packages that Typer depends on.550 551 Then it will **extract** all those files and put them in a directory in your computer.54 unmodified lines606 ////607 608 //// tab | Windows Bash609 610-Or if you use Bash for Windows (e.g. <a href="https://gitforwindows.org/" class="external-link" target="_blank">Git Bash</a>):610+Or if you use Bash for Windows (e.g. [Git Bash](https://gitforwindows.org/)):611 612 <div class="termy">613 614 ```console3 unmodified lines618 </div>619 620 ////621 622-That command will create or modify some [environment variables](environment-variables.md){.internal-link target=_blank} that will be available for the next commands.622+That command will create or modify some [environment variables](environment-variables.md) that will be available for the next commands.623 624 One of those variables is the `PATH` variable.625 626 /// tip627 628-You can learn more about the `PATH` environment variable in the [Environment Variables](environment-variables.md#path-environment-variable){.internal-link target=_blank} section.628+You can learn more about the `PATH` environment variable in the [Environment Variables](environment-variables.md#path-environment-variable) section.629 630 ///631 632 Activating a virtual environment adds its path `.venv/bin` (on Linux and macOS) or `.venv\Scripts` (on Windows) to the `PATH` environment variable.192 unmodified lines825 This is a simple guide to get you started and teach you how everything works **underneath**.826 827 There are many **alternatives** to managing virtual environments, package dependencies (requirements), projects.828 829-Once you are ready and want to use a tool to **manage the entire project**, packages dependencies, virtual environments, etc. I would suggest you try <a href="https://github.com/astral-sh/uv" class="external-link" target="_blank">uv</a>.829+Once you are ready and want to use a tool to **manage the entire project**, packages dependencies, virtual environments, etc. I would suggest you try [uv](https://github.com/astral-sh/uv).830 831 `uv` can do a lot of things, it can:832 833 * **Install Python** for you, including different versions11 unmodified linesmodified:README.md+11 added-11 removed
4 unmodified lines5 <p align="center">6 <em>Typer, build great CLIs. Easy to code. Based on Python type hints.</em>7 </p>8 <p align="center">9-<a href="https://github.com/fastapi/typer/actions?query=workflow%3ATest+event%3Apush+branch%3Amaster" target="_blank">9+<a href="https://github.com/fastapi/typer/actions?query=workflow%3ATest+event%3Apush+branch%3Amaster">10 <img src="https://github.com/fastapi/typer/actions/workflows/test.yml/badge.svg?event=push&branch=master" alt="Test">11 </a>12-<a href="https://github.com/fastapi/typer/actions?query=workflow%3APublish" target="_blank">12+<a href="https://github.com/fastapi/typer/actions?query=workflow%3APublish">13 <img src="https://github.com/fastapi/typer/workflows/Publish/badge.svg" alt="Publish">14 </a>15-<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/typer" target="_blank">15+<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/typer">16 <img src="https://coverage-badge.samuelcolvin.workers.dev/fastapi/typer.svg" alt="Coverage">17-<a href="https://pypi.org/project/typer" target="_blank">17+<a href="https://pypi.org/project/typer">18 <img src="https://img.shields.io/pypi/v/typer?color=%2334D058&label=pypi%20package" alt="Package version">19 </a>20 </p>21 22 ---23 24-**Documentation**: <a href="https://typer.tiangolo.com" target="_blank">https://typer.tiangolo.com</a>24+**Documentation**: [https://typer.tiangolo.com](https://typer.tiangolo.com)25 26-**Source Code**: <a href="https://github.com/fastapi/typer" target="_blank">https://github.com/fastapi/typer</a>26+**Source Code**: [https://github.com/fastapi/typer](https://github.com/fastapi/typer)27 28 ---29 30 Typer is a library for building <abbr title="command line interface, programs executed from a terminal">CLI</abbr> applications that users will **love using** and developers will **love creating**. Based on Python type hints.10 unmodified lines41 * **Run scripts**: Typer includes a `typer` command/program that you can use to run scripts, automatically converting them to CLIs, even if they don't use Typer internally.42 43 ## FastAPI of CLIs44 45-**Typer** is <a href="https://fastapi.tiangolo.com" class="external-link" target="_blank">FastAPI</a>'s little sibling, it's the FastAPI of CLIs.45+**Typer** is [FastAPI](https://fastapi.tiangolo.com)'s little sibling, it's the FastAPI of CLIs.46 47 ## Installation48 49-Create and activate a <a href="https://typer.tiangolo.com/virtual-environments/" class="external-link" target="_blank">virtual environment</a> and then install **Typer**:49+Create and activate a [virtual environment](https://typer.tiangolo.com/virtual-environments/) and then install **Typer**:50 51 <div class="termy">52 53 ```console299 unmodified lines353 ## Dependencies354 355 **Typer** stands on the shoulders of giants. It has three required dependencies:356 357-* <a href="https://click.palletsprojects.com/" class="external-link" target="_blank">Click</a>: a popular tool for building CLIs in Python. Typer is based on it.358-* <a href="https://rich.readthedocs.io/en/stable/index.html" class="external-link" target="_blank"><code>rich</code></a>: to show nicely formatted errors automatically.359-* <a href="https://github.com/sarugaku/shellingham" class="external-link" target="_blank"><code>shellingham</code></a>: to automatically detect the current shell when installing completion.357+* [Click](https://click.palletsprojects.com/): a popular tool for building CLIs in Python. Typer is based on it.358+* [`rich`](https://rich.readthedocs.io/en/stable/index.html): to show nicely formatted errors automatically.359+* [`shellingham`](https://github.com/sarugaku/shellingham): to automatically detect the current shell when installing completion.360 361 ### `typer-slim`362 363 There used to be a slimmed-down version of Typer called `typer-slim`, which didn't include the dependencies `rich` and `shellingham`, nor the `typer` command.8 unmodified lines