本文へ移動
cccskills
無料GitHub で公開日本語紹介

typer

TyperでPython製CLIを組み立てる際に、コマンドや引数、ヘルプ、補完、テスト、パッケージ化の方法を調べられます。

原文原文の説明を見る

Use when building CLI applications with fastapi/typer — creating commands, defining CLI arguments and options, type-hint-driven parameter parsing, callbacks, context, help customization, shell completion, testing, packaging, or Typer internals. Triggers on: "typer", "typer.run", "typer.Typer", "typer app", "typer command", "typer argument", "typer option", "typer callback", "typer context", "Annotated", "typer.Argument", "typer.Option", "typer.Context", "CliRunner", "add_typer", "rich_markup_mode", "typer completion", "typer autocompletion", "typer echo", "typer test", "typer package", "typer click", "get_command".

carapace-sh/carapace-binスター 2,000(GitHub 2,000 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • CLIのコマンドを設計したいとき
  • 型ヒントで引数を定義したいとき
  • ヘルプやシェル補完を整えたいとき
  • CLIのテストや配布を調べたいとき

日本語での紹介

できること

Typerを使ったPython製CLIアプリの作り方を、作業に合ったリファレンスから確認できます。コマンドやサブコマンドの作成、型ヒントを使った引数・オプションの定義、コールバックやコンテキストの扱いを調べられます。ヘルプ表示やRichマークアップの調整、シェル補完、pytestとCliRunnerによるテスト、パッケージ化も扱います。TyperがClick向けのコマンドに変換される仕組みなど、内部構造の説明も含まれます。

こんなときに便利

CLIの設計を始めるときや、引数の型や必須・任意の指定に迷ったときに役立ちます。ヘルプを読みやすく整えたい、補完を追加したい、コマンドのテストや配布方法を確認したい場合にも使えます。

使い方の例

  • 「Typerでサブコマンドを作る方法を教えて」
  • 「このCLIの引数とオプションを型ヒントで定義したい」
  • 「TyperアプリをCliRunnerでテストする方法を調べて」

注意点

対象バージョンはTyper 0.12以降から0.27.xです。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(10)

  • SKILL.md5.1 KB
  • references/commands.md6.4 KB
  • references/completion.md4.3 KB
  • references/context.md4.9 KB
  • references/help-output.md4.5 KB
  • references/internals.md7.4 KB
  • references/package.md2.8 KB
  • references/parameter-types.md5.6 KB
  • references/parameters.md6.9 KB
  • references/testing.md3.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Typer CLI Application Reference

Reference for building CLI applications with typer. Covers the public API, type-driven parameter declaration, and how Typer wraps Click internally.

Sub-Resources

Load the reference that matches your task. When in doubt, load multiple references.

KeywordsReference
Typer, typer.run, app, @app.command, @app.callback, add_typer, subcommand, group, one or multiple commands, TyperInfo, CommandInfo, suggest_commands, invoke_without_commandreferences/commands.md
typer.Argument, typer.Option, Annotated, default value style, Ellipsis, required, optional, envvar, prompt, confirmation_prompt, short name, metavar, show_default, help, OptionInfo, ArgumentInfo, ParamMetareferences/parameters.md
type conversion, parameter type, str, int, float, bool, Enum, Literal, choices, case_sensitive, FileText, FileTextWrite, FileBinaryRead, FileBinaryWrite, pathlib.Path, exists, min, max, clamp, count, DateTime, UUID, list, tuplereferences/parameter-types.md
typer.Context, ctx, CallbackParam, invoked_subcommand, resilient_parsing, allow_extra_args, ignore_unknown_options, find_root, find_object, ensure_object, fail, abort, exit, get_parameter_sourcereferences/context.md
help, docstring, rich, rich_markup_mode, rich_help_panel, markdown help, deprecated, epilog, printing, echo, style, secho, stderr, rich markup, suggest_commandsreferences/help-output.md
completion, shell completion, install-completion, show-completion, autocompletion, incomplete, shellingham, custom completion, completion functionreferences/completion.md
testing, pytest, CliRunner, Result, invoke, exit_code, input, isolated filesystemreferences/testing.md
package, pyproject.toml, project.scripts, wheel, python -m, main.py, publish, docs generationreferences/package.md
internals, source code, main.py, core.py, models.py, utils.py, _click, vendored click, get_command, get_group_from_info, get_command_from_info, get_callback, TyperGroup, TyperCommand, TyperOption, TyperArgument, DefaultPlaceholder, rich_utilsreferences/internals.md

Quick Guide

Cross-Project References

  • For the completion-aware pflag/cobra ecosystem used in this repo, see the cobra skill (in this repo, skills/cobra/). Typer is Click-based, not cobra-based; Typer's own internals are covered in references/internals.md.
  • For FastAPI itself, Typer's design mirrors it (dependency injection, declarative type hints) but there is no FastAPI skill here.

Note

Typer versions covered: 0.12+ through 0.27.x. Since v0.26.0 Click is vendored inside typer/_click/, so no external Click dependency exists at runtime (see references/internals.md).

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

brew

無料概要あり

macOSやLinuxのHomebrewについて、brewコマンドでの導入・更新から、FormulaやCask、Brewfile、サービス管理、開発者向け操作まで調べられるスキルです。

  • Homebrewでソフトを導入・更新したいとき
  • Brewfileで環境を管理したいとき
  • FormulaやCaskを作成・更新したいとき
carapace-sh/carapace-bin2,0002026年10月26日 更新

bubbletea

無料概要あり

Go製TUIフレームワークBubble Teaの画面構成、入力・非同期処理、テスト、部品の組み合わせ方を調べ、端末アプリの実装や設計に活用できます。

  • Bubble Teaで端末画面を作りたいとき
  • キーやマウス入力を処理したいとき
  • 非同期処理を画面に組み込みたいとき
carapace-sh/carapace-bin2,0002026年10月26日 更新

bun

無料概要あり

BunのCLI、パッケージ管理、テスト、バンドル、実行時APIやシェルの使い方を調べ、JavaScript・TypeScriptの開発作業に活用できます。

  • Bunで依存パッケージを管理したいとき
  • テストやコードのバンドルを実行したいとき
  • Bunでサーバーやファイル処理を実装したいとき
carapace-sh/carapace-bin2,0002026年10月26日 更新

but

無料概要あり

GitButler CLIで仮想ブランチや積み重ねたブランチを管理し、変更の割り当て、コミット編集、競合解決、PR作成までのGit作業を進められます。

  • 作業を仮想ブランチに分けたいとき
  • コミットを修正・統合したいとき
  • 操作履歴を見て変更を取り消したいとき
carapace-sh/carapace-bin2,0002026年10月26日 更新

carapace

無料概要あり

carapaceをCLIに組み込み、シェル補完のYAML仕様や独自アクションを作成し、シェル設定やMCP連携、補完値の説明まで扱うスキルです。

  • CLIにシェル補完を追加したいとき
  • YAMLの補完仕様を作成したいとき
  • 独自の補完アクションを実装したいとき
carapace-sh/carapace-bin2,0002026年10月26日 更新

cargo

無料概要あり

Rustプロジェクトのビルドやテストから、依存関係、ワークスペース、公開設定まで、`cargo`の使い方と設定を調べられるスキルです。

  • Rustプロジェクトの依存関係を設定したいとき
  • featureやworkspaceの仕組みを確認したいとき
  • ビルドやテストのコマンドを調べたいとき
carapace-sh/carapace-bin2,0002026年10月26日 更新

carapace-sh のスキルをすべて見る

このスキルの問題を報告する