skillfed

msgspec-click

Generate Click options from msgspec types

msgspec-click v0.2.1 75.0K downloads/30d#14,763 on PyPI13
License unclear DORMANT released

What it is and what it does

msgspec-click bridges two Python libraries: msgspec (a fast serialization library with type validation) and click (a command-line interface framework). It lets you define CLI options as msgspec types—typically dataclasses or structs—and automatically generates click decorators from those definitions, eliminating repetitive option declarations.

The package is designed for developers who want type-safe CLI applications without manually wiring up each argument and option. Instead of writing click decorators by hand, you define your CLI interface as a msgspec type and let the library generate the boilerplate. It supports Python 3.8 through 3.12 on both CPython and PyPy.

Use it for:

  • Build a CLI tool where all arguments and options are defined once as a msgspec type, then auto-converted to click decorators.
  • Create type-validated command-line interfaces that catch invalid input at parse time using msgspec's validation.
  • Reduce boilerplate in multi-command CLI applications by deriving click option groups from structured type definitions.
  • Prototype CLI tools quickly by defining the interface as Python types rather than writing click decorator chains.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates Click command-line options automatically from msgspec type definitions, reducing boilerplate when building CLI applications with structured type validation.

Yes, if you are already using both click and msgspec and want to reduce CLI boilerplate—the install is frictionless and there are no known vulnerabilities. However, proceed cautiously: the project is dormant (last release 689 days ago), has minimal adoption (74957 monthly downloads, rank 14763), and the license metadata is unclear. Use it for new projects only if you are comfortable maintaining a fork or accepting no upstream updates.

Install

msgspec-click on PyPI

pip

pip install msgspec-click

uv

uv add msgspec-click

poetry

poetry add msgspec-click

Installing msgspec-click

Before you install

Low friction install with only two runtime dependencies (click and msgspec). Dormant maintenance status—last release was 689 days ago, so expect no active bug fixes or feature development.

License in practice

License treatment is unclear in the metadata. Verify the actual license terms before relying on this package in production.

Quickstart

pip install msgspec-click

from msgspec import Struct
import click
from msgspec_click import create_command

class Options(Struct):
    name: str
    count: int = 1

cmd = create_command(Options)

if __name__ == '__main__':
    cmd()

Requires Python 3.8 or later; both click and msgspec must be installed as runtime dependencies.

Verify before relying

  • Actual license file or SPDX identifier not present in metadata despite MIT reference in description
  • Whether dormancy signals end-of-life or stable maintenance mode
  • Real-world stability and usage patterns given low adoption metrics

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 2 — click, msgspec
Maintenance dormant — 689 days since the last release
Last repo commit
First released
Downloads 74,957/month — #14,763 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: msgspec_click-0.2.1-py3-none-any.whl

Keywords: click, msgspec

Development Status :: 4 - BetaProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

click cli option generatormsgspec type to click decoratorautomated cli argument parsingtype-driven command line interfaceclick dataclass integrationstructured cli validation
cli-generationtype-driven

More Application Frameworks packages