yandex/yatool/typer
Claude Code and agent skill by yandex/yatool
- community
Checking that the SKILL.md file is still in the repository.
Typer best practices and conventions. Use when working with Typer CLIs. Keeps Typer code clean and up to date with the latest features and patterns, updated with new versions. Write new code or refactor and update old code.
Install
npx vskill@latest install yandex/yatool/typerSKILL.md
The same SKILL.md was published earlier as pybuilder/pybuilder/typer.
Typer
Official Typer skill to write code with best practices, keeping up to date with new versions and features.
Installing typer
In a virtual environment, pip install typer (with pip) or uv pip install typer (with uv). For your library/project, add typer to the dependencies in pyproject.toml.
Do not install typer-slim or typer-cli, they are both deprecated and will now simply install typer.
Typer supports Python 3.10 and above.
Use an explicit Typer app
For maximum generalizability, create an explicit Typer app and register subcommand(s), instead of using typer.run:
instead of:
Execute the app
To execute the app in the terminal, run
When multiple commands are registered to the Typer app, you have to add the command name:
To see the automatically generated help documentation, run
or set no_args_is_help to True when creating the Typer() add to automatically show the help when running a command without any arguments.
Use Annotated
Always prefer the Annotated style for declarations of CLI arguments and options.
It allows us to pass additional metadata that can be used by Typer.
This program can be run as-is, or can provide a specific name:
An older way of setting a default value is this:
Similarly, the old style could use ellipsis (...) to explicitly mark an argument as required.
CLI Options
CLI options are declared in a similar fashion as arguments, but will be called on the CLI with a single dash (single letter) or 2 dashes (full name).
The CLI option name is automatically generated from the variable name, so user_name becomes --user-name automatically:
If you want to specify a different name, or want to add a short version, declare them in the typer.Option:
You can run this program as such:
CLI options with multiple values
By declaring a CLI option as a list, it can receive multiple values:
This can be executed like so:
Rich
By default, Rich can be used with its custom markup syntax to set colors and styles, e.g.
Typer supports using Rich formatting in the docstrings and the help messages of CLI arguments and CLI options.
To disable Rich formatting, set rich_markup_mode to None when creating a Typer() app. By default (when no value is given), Rich formatting is enabled.
Rich markdown
You can also set rich_markup_mode to "markdown" to use Markdown in the docstring:
Click
Originally, Typer was built on Click. However, since version 0.26.0, Typer has vendored Click. As such, Click extensions should not be used anymore.
Other settings of Option and Argument that came from Click but shouldn't be used in Typer anymore, include: expose_value, shell_complete, show_choices, errors, prompt_required, is_flag, flag_value and allow_from_autoenv.
Code bases using these should be refactored to use pure Typer functionality.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcontrib/python/typer/typer/.agents/skills/typer/SKILL.md
Popularity
- Repository stars
- 227
- Repository forks
- 32
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/yandex/yatool/typer)