[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2506":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":16,"starSnapshotCount":16,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},2506,"typer","fastapi\u002Ftyper","fastapi","Typer, build great CLIs. Easy to code. Based on Python type hints.","https:\u002F\u002Ftyper.tiangolo.com\u002F",null,"Python",19550,909,74,1,0,6,27,167,104.38,"MIT License",false,"master",[25,26,27,28,29,30,31,5],"cli","click","python","python3","shell","terminal","typehints","2026-06-12 04:00:14","\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Ftyper.tiangolo.com\">\u003Cimg src=\"https:\u002F\u002Ftyper.tiangolo.com\u002Fimg\u002Flogo-margin\u002Flogo-margin-vector.svg#only-light\" alt=\"Typer\">\u003C\u002Fa>\n\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n    \u003Cem>Typer, build great CLIs. Easy to code. Based on Python type hints.\u003C\u002Fem>\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Ffastapi\u002Ftyper\u002Factions?query=workflow%3ATest+event%3Apush+branch%3Amaster\" target=\"_blank\">\n    \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Ffastapi\u002Ftyper\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg?event=push&branch=master\" alt=\"Test\">\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Ffastapi\u002Ftyper\u002Factions?query=workflow%3APublish\" target=\"_blank\">\n    \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Ffastapi\u002Ftyper\u002Fworkflows\u002FPublish\u002Fbadge.svg\" alt=\"Publish\">\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fcoverage-badge.samuelcolvin.workers.dev\u002Fredirect\u002Ffastapi\u002Ftyper\" target=\"_blank\">\n    \u003Cimg src=\"https:\u002F\u002Fcoverage-badge.samuelcolvin.workers.dev\u002Ffastapi\u002Ftyper.svg\" alt=\"Coverage\">\n\u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Ftyper\" target=\"_blank\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Ftyper?color=%2334D058&label=pypi%20package\" alt=\"Package version\">\n\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\n**Documentation**: \u003Ca href=\"https:\u002F\u002Ftyper.tiangolo.com\" target=\"_blank\">https:\u002F\u002Ftyper.tiangolo.com\u003C\u002Fa>\n\n**Source Code**: \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Ffastapi\u002Ftyper\" target=\"_blank\">https:\u002F\u002Fgithub.com\u002Ffastapi\u002Ftyper\u003C\u002Fa>\n\n---\n\nTyper is a library for building \u003Cabbr title=\"command line interface, programs executed from a terminal\">CLI\u003C\u002Fabbr> applications that users will **love using** and developers will **love creating**. Based on Python type hints.\n\nIt's also a command line tool to run scripts, automatically converting them to CLI applications.\n\nThe key features are:\n\n* **Intuitive to write**: Great editor support. \u003Cabbr title=\"also known as auto-complete, autocompletion, IntelliSense\">Completion\u003C\u002Fabbr> everywhere. Less time debugging. Designed to be easy to use and learn. Less time reading docs.\n* **Easy to use**: It's easy to use for the final users. Automatic help, and automatic completion for all shells.\n* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.\n* **Start simple**: The simplest example adds only 2 lines of code to your app: **1 import, 1 function call**.\n* **Grow large**: Grow in complexity as much as you want, create arbitrarily complex trees of commands and groups of subcommands, with options and arguments.\n* **Run scripts**: Typer includes a `typer` command\u002Fprogram that you can use to run scripts, automatically converting them to CLIs, even if they don't use Typer internally.\n\n## FastAPI of CLIs\n\n**Typer** is \u003Ca href=\"https:\u002F\u002Ffastapi.tiangolo.com\" class=\"external-link\" target=\"_blank\">FastAPI\u003C\u002Fa>'s little sibling, it's the FastAPI of CLIs.\n\n## Installation\n\nCreate and activate a \u003Ca href=\"https:\u002F\u002Ftyper.tiangolo.com\u002Fvirtual-environments\u002F\" class=\"external-link\" target=\"_blank\">virtual environment\u003C\u002Fa> and then install **Typer**:\n\n\u003Cdiv class=\"termy\">\n\n```console\n$ pip install typer\n---> 100%\nSuccessfully installed typer rich shellingham\n```\n\n\u003C\u002Fdiv>\n\n## Example\n\n### The absolute minimum\n\n* Create a file `main.py` with:\n\n```Python\ndef main(name: str):\n    print(f\"Hello {name}\")\n```\n\nThis script doesn't even use Typer internally. But you can use the `typer` command to run it as a CLI application.\n\n### Run it\n\nRun your application with the `typer` command:\n\n\u003Cdiv class=\"termy\">\n\n```console\n\u002F\u002F Run your application\n$ typer main.py run\n\n\u002F\u002F You get a nice error, you are missing NAME\nUsage: typer [PATH_OR_MODULE] run [OPTIONS] NAME\nTry 'typer [PATH_OR_MODULE] run --help' for help.\n╭─ Error ───────────────────────────────────────────╮\n│ Missing argument 'NAME'.                          │\n╰───────────────────────────────────────────────────╯\n\n\n\u002F\u002F You get a --help for free\n$ typer main.py run --help\n\nUsage: typer [PATH_OR_MODULE] run [OPTIONS] NAME\n\nRun the provided Typer app.\n\n╭─ Arguments ───────────────────────────────────────╮\n│ *    name      TEXT  [default: None] [required]   |\n╰───────────────────────────────────────────────────╯\n╭─ Options ─────────────────────────────────────────╮\n│ --help          Show this message and exit.       │\n╰───────────────────────────────────────────────────╯\n\n\u002F\u002F Now pass the NAME argument\n$ typer main.py run Camila\n\nHello Camila\n\n\u002F\u002F It works! 🎉\n```\n\n\u003C\u002Fdiv>\n\nThis is the simplest use case, not even using Typer internally, but it can already be quite useful for simple scripts.\n\n**Note**: auto-completion works when you create a Python package and run it with `--install-completion` or when you use the `typer` command.\n\n## Use Typer in your code\n\nNow let's start using Typer in your own code, update `main.py` with:\n\n```Python\nimport typer\n\n\ndef main(name: str):\n    print(f\"Hello {name}\")\n\n\nif __name__ == \"__main__\":\n    typer.run(main)\n```\n\nNow you could run it with Python directly:\n\n\u003Cdiv class=\"termy\">\n\n```console\n\u002F\u002F Run your application\n$ python main.py\n\n\u002F\u002F You get a nice error, you are missing NAME\nUsage: main.py [OPTIONS] NAME\nTry 'main.py --help' for help.\n╭─ Error ───────────────────────────────────────────╮\n│ Missing argument 'NAME'.                          │\n╰───────────────────────────────────────────────────╯\n\n\n\u002F\u002F You get a --help for free\n$ python main.py --help\n\nUsage: main.py [OPTIONS] NAME\n\n╭─ Arguments ───────────────────────────────────────╮\n│ *    name      TEXT  [default: None] [required]   |\n╰───────────────────────────────────────────────────╯\n╭─ Options ─────────────────────────────────────────╮\n│ --help          Show this message and exit.       │\n╰───────────────────────────────────────────────────╯\n\n\u002F\u002F Now pass the NAME argument\n$ python main.py Camila\n\nHello Camila\n\n\u002F\u002F It works! 🎉\n```\n\n\u003C\u002Fdiv>\n\n**Note**: you can also call this same script with the `typer` command, but you don't need to.\n\n## Example upgrade\n\nThis was the simplest example possible.\n\nNow let's see one a bit more complex.\n\n### An example with two subcommands\n\nModify the file `main.py`.\n\nCreate a `typer.Typer()` app, and create two subcommands with their parameters.\n\n```Python hl_lines=\"3  6  11  20\"\nimport typer\n\napp = typer.Typer()\n\n\n@app.command()\ndef hello(name: str):\n    print(f\"Hello {name}\")\n\n\n@app.command()\ndef goodbye(name: str, formal: bool = False):\n    if formal:\n        print(f\"Goodbye Ms. {name}. Have a good day.\")\n    else:\n        print(f\"Bye {name}!\")\n\n\nif __name__ == \"__main__\":\n    app()\n```\n\nAnd that will:\n\n* Explicitly create a `typer.Typer` app.\n    * The previous `typer.run` actually creates one implicitly for you.\n* Add two subcommands with `@app.command()`.\n* Execute the `app()` itself, as if it was a function (instead of `typer.run`).\n\n### Run the upgraded example\n\nCheck the new help:\n\n\u003Cdiv class=\"termy\">\n\n```console\n$ python main.py --help\n\n Usage: main.py [OPTIONS] COMMAND [ARGS]...\n\n╭─ Options ─────────────────────────────────────────╮\n│ --install-completion          Install completion  │\n│                               for the current     │\n│                               shell.              │\n│ --show-completion             Show completion for │\n│                               the current shell,  │\n│                               to copy it or       │\n│                               customize the       │\n│                               installation.       │\n│ --help                        Show this message   │\n│                               and exit.           │\n╰───────────────────────────────────────────────────╯\n╭─ Commands ────────────────────────────────────────╮\n│ goodbye                                           │\n│ hello                                             │\n╰───────────────────────────────────────────────────╯\n\n\u002F\u002F When you create a package you get ✨ auto-completion ✨ for free, installed with --install-completion\n\n\u002F\u002F You have 2 subcommands (the 2 functions): goodbye and hello\n```\n\n\u003C\u002Fdiv>\n\nNow check the help for the `hello` command:\n\n\u003Cdiv class=\"termy\">\n\n```console\n$ python main.py hello --help\n\n Usage: main.py hello [OPTIONS] NAME\n\n╭─ Arguments ───────────────────────────────────────╮\n│ *    name      TEXT  [default: None] [required]   │\n╰───────────────────────────────────────────────────╯\n╭─ Options ─────────────────────────────────────────╮\n│ --help          Show this message and exit.       │\n╰───────────────────────────────────────────────────╯\n```\n\n\u003C\u002Fdiv>\n\nAnd now check the help for the `goodbye` command:\n\n\u003Cdiv class=\"termy\">\n\n```console\n$ python main.py goodbye --help\n\n Usage: main.py goodbye [OPTIONS] NAME\n\n╭─ Arguments ───────────────────────────────────────╮\n│ *    name      TEXT  [default: None] [required]   │\n╰───────────────────────────────────────────────────╯\n╭─ Options ─────────────────────────────────────────╮\n│ --formal    --no-formal      [default: no-formal] │\n│ --help                       Show this message    │\n│                              and exit.            │\n╰───────────────────────────────────────────────────╯\n\n\u002F\u002F Automatic --formal and --no-formal for the bool option 🎉\n```\n\n\u003C\u002Fdiv>\n\nNow you can try out the new command line application:\n\n\u003Cdiv class=\"termy\">\n\n```console\n\u002F\u002F Use it with the hello command\n\n$ python main.py hello Camila\n\nHello Camila\n\n\u002F\u002F And with the goodbye command\n\n$ python main.py goodbye Camila\n\nBye Camila!\n\n\u002F\u002F And with --formal\n\n$ python main.py goodbye --formal Camila\n\nGoodbye Ms. Camila. Have a good day.\n```\n\n\u003C\u002Fdiv>\n\n**Note**: If your app only has one command, by default the command name is **omitted** in usage: `python main.py Camila`. However, when there are multiple commands, you must **explicitly include the command name**: `python main.py hello Camila`. See [One or Multiple Commands](https:\u002F\u002Ftyper.tiangolo.com\u002Ftutorial\u002Fcommands\u002Fone-or-multiple\u002F) for more details.\n\n### Recap\n\nIn summary, you declare **once** the types of parameters (*CLI arguments* and *CLI options*) as function parameters.\n\nYou do that with standard modern Python types.\n\nYou don't have to learn a new syntax, the methods or classes of a specific library, etc.\n\nJust standard **Python**.\n\nFor example, for an `int`:\n\n```Python\ntotal: int\n```\n\nor for a `bool` flag:\n\n```Python\nforce: bool\n```\n\nAnd similarly for **files**, **paths**, **enums** (choices), etc. And there are tools to create **groups of subcommands**, add metadata, extra **validation**, etc.\n\n**You get**: great editor support, including **completion** and **type checks** everywhere.\n\n**Your users get**: automatic **`--help`**, **auto-completion** in their terminal (Bash, Zsh, Fish, PowerShell) when they install your package or when using the `typer` command.\n\nFor a more complete example including more features, see the \u003Ca href=\"https:\u002F\u002Ftyper.tiangolo.com\u002Ftutorial\u002F\">Tutorial - User Guide\u003C\u002Fa>.\n\n## Dependencies\n\n**Typer** stands on the shoulders of giants. It has three required dependencies:\n\n* \u003Ca href=\"https:\u002F\u002Fclick.palletsprojects.com\u002F\" class=\"external-link\" target=\"_blank\">Click\u003C\u002Fa>: a popular tool for building CLIs in Python. Typer is based on it.\n* \u003Ca href=\"https:\u002F\u002Frich.readthedocs.io\u002Fen\u002Fstable\u002Findex.html\" class=\"external-link\" target=\"_blank\">\u003Ccode>rich\u003C\u002Fcode>\u003C\u002Fa>: to show nicely formatted errors automatically.\n* \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fsarugaku\u002Fshellingham\" class=\"external-link\" target=\"_blank\">\u003Ccode>shellingham\u003C\u002Fcode>\u003C\u002Fa>: to automatically detect the current shell when installing completion.\n\n### `typer-slim`\n\nThere 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.\n\nHowever, since version 0.22.0, we have stopped supporting this, and `typer-slim` now simply installs (all of) Typer.\n\nIf you want to disable Rich globally, you can set an environmental variable `TYPER_USE_RICH` to `False` or `0`.\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n","Typer 是一个用于构建命令行界面（CLI）应用的库，使开发者能够基于 Python 类型提示轻松创建用户友好的 CLI 应用。其核心功能包括直观的代码编写体验、自动补全和帮助文档生成等，极大地减少了开发者的调试时间和学习成本。此外，Typer 还支持将普通脚本自动转换为完整的 CLI 应用程序。适合需要快速开发强大且易于使用的命令行工具的各种场景，无论是简单的单命令应用还是复杂的多层次命令结构都能胜任。",2,"2026-06-11 02:50:08","top_language"]