You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proposal: official Python Typer/Click exporter SDK #6
I would like to contribute a small Python integration that makes existing Typer or Click CLIs expose a valid CLI Schema document through the reserved __schema meta-command, with an optional sidecar writer.
Goals:
additive: existing commands and help output remain unchanged;
derive command trees, options, positionals, enum values, defaults, aliases, and repeatability from the framework metadata;
require explicit annotations for safety semantics such as intent, confirmation-skip, dry-run, auth, and output formats rather than guessing;
validate generated documents against the repository meta-schema in tests;
ship a runnable example and generated-schema fixture.
Before preparing a PR, I would like to align on ownership and layout. Would you prefer (a) a reference implementation / integration package in this repository, or (b) a separately versioned cli-schema-typer package with documentation and a link here?
I plan to begin with Typer, then add direct Click support if the mapping remains framework-agnostic. The generated JSON will use only current v1 fields; any missing cross-parameter constraints or output-schema features can be proposed separately after implementation experience.
It currently supports existing Click command trees and Typer applications, emits only current CLI Schema v1 fields, provides the reserved __schema discovery path, and can write the specified sidecar file. Safety metadata remains explicit; it does not infer destructive/auth/confirmation semantics.
One implementation detail surfaced immediately: adding a hidden subcommand to a single-command Typer app changes its invocation shape, so the Typer integration uses an entry-point wrapper that intercepts only mytool __schema and otherwise delegates unchanged to the app. Click can use a hidden command without that issue.
The prototype includes Click and Typer integration coverage. I will keep it as a separate package pending your preference on whether it should move under this repository or an official SDK repository.
That sounds great — thank you! I agree that a separate repository is the right long-term home for the integration.
My preference would be:
cli-schema/typer for the GitHub repository;
cli-schema-typer for the Python distribution name;
cli-schema/python as a lightweight landing page that links to the available Python integrations and documents the shared conventions.
I would keep the direct Click support in the Typer repository for now. Typer compiles its application model into a Click command tree, so both integrations currently share the same exporter and parameter-mapping implementation. Splitting them at this stage would mostly duplicate code. We can always separate them later if their APIs, release cycles, or ownership diverge.
I am happy to transfer the existing repository while preserving its history. Let me know whether you would prefer to create cli-schema/typer first and have me push the repository there, or enable a direct GitHub repository transfer into the organization.
After the move, I propose the first official milestone include:
validating generated documents against the official CLI Schema meta-schema in CI;
runnable Typer and Click examples;
checked-in generated-schema fixtures;
a Python/Click/Typer compatibility matrix;
CI and release automation;
a short ownership and contribution document.
For governance, a Python subteam makes sense as the ecosystem grows. Initially, repository-level maintainers or a small CODEOWNERS entry may be enough, without making the team structure a blocker for the transfer.
Does cli-schema/typer for the repository, while retaining cli-schema-typer as the package name, sound good to you?
Hi @Mpdreamz — following up on the transfer, with one small proposal and a status update.
Naming: I'd like to revise my earlier cli-schema/typer suggestion to cli-schema/py. Your cli-schema-js monorepo (which I only saw after my last comment) sets a nicer convention than what we discussed: one repository per language, with framework integrations as packages inside (packages/commander, packages/zod, ...). Mirroring that for Python keeps the org symmetric:
cli-schema/py — repository, monorepo layout
packages/typer — the integration, PyPI name cli-schema-typer (unchanged); direct Click support lives here too since Typer compiles to a Click tree
room for future packages/click, packages/argparse, etc. under the same roof, owned by the Python subteam you proposed
I'll restructure dull-bird/cli-schema-typer into that layout before the move, so no code changes are needed on your side.
To unblock the transfer, whichever is less friction for you — both are a single action:
create an empty cli-schema/py and add me as maintainer on it; I'll push the restructured repository, or
I initiate a GitHub transfer of dull-bird/cli-schema-typer into the org and you accept + rename it to py.
If you also create the python team with me as maintainer at the same time, future Python-side work (new integrations, releases) won't need to wait on you.
Meanwhile, on the JS side: I've opened cli-schema/cli-schema-js#3, which wires up the spec §4 discovery mechanisms for @cli-schema/commander — a __schema meta-command served by argv interception before parsing (avoids the single-command routing change I hit on Typer), plus the <binary>.cli-schema.json sidecar writer. CI is green locally; the workflow run just needs a first-time-contributor approval when you have a moment.
No rush on any of this — I know maintainer time is scarce. Everything above is structured so that one visit from you unblocks everything on my side.
Mirrors cli-schema-js: one repo per language, integrations as packages inside. Direct Click support stays colocated with Typer since Typer compiles to a Click tree; we can split into packages/click later if APIs diverge. Tests still pass (4/4) in the new layout.
A few things I noticed:
The repo is currently private — assuming that was just the default when you created it. Want me to flip it to public, or hold off until we've shipped the first release?
I'd like to keep dull-bird/cli-schema-typer archived + a note in its README pointing to the new home, so existing links redirect. Sound good?
For OIDC releases: when you're ready, happy to help wire up a release.yml modeled on cli-schema-js — or leave it to you if you prefer to set the pattern first.
Next on my plate: adding CI (pytest across Python/Click/Typer versions), a meta-schema validation step against cli-schema/cli-schema, and a CODEOWNERS entry. Let me know if you'd like any of those sequenced differently.
@Mpdreamz no worries — hope the holidays were good!
The first infrastructure batch is now on cli-schema/cli-schema-py:
CI: pytest across Python 3.10–3.14 × Typer (latest + 0.12.x)
Release automation: release.yml mirrors cli-schema-js — workflow_dispatch → release-drafter → PyPI via OIDC trusted publishing (environment pypi-publish, bare-SemVer tag injected into pyproject.toml, wheel smoke-tested before upload). Ready for you to connect as a pending trusted publisher on pypi.org whenever the org request clears.
Meta-schema validation: generated documents are validated in tests against the vendored official meta-schema; the runnable Typer example ships a checked-in fixture kept fresh by a test.
CODEOWNERS → @cli-schema/python.
The Typer version matrix immediately paid off: Typer ≥ 0.27 vendors its own Click fork (typer._click), so its core classes no longer subclass Click's and the exporter misclassified every parameter. Fixed by matching both class hierarchies — both Typer lines are green.
One thing I cannot do from my side: flipping the repo to public needs admin — either you flip it, or grant the python team admin and I will take care of it. I will archive dull-bird/cli-schema-typer with a pointer to the new home right after.
Activity
dull-bird commentedon Jun 22, 2026
I have published a first working prototype: https://github.com/dull-bird/cli-schema-typer
It currently supports existing Click command trees and Typer applications, emits only current CLI Schema v1 fields, provides the reserved
__schemadiscovery path, and can write the specified sidecar file. Safety metadata remains explicit; it does not infer destructive/auth/confirmation semantics.One implementation detail surfaced immediately: adding a hidden subcommand to a single-command Typer app changes its invocation shape, so the Typer integration uses an entry-point wrapper that intercepts only
mytool __schemaand otherwise delegates unchanged to the app. Click can use a hidden command without that issue.The prototype includes Click and Typer integration coverage. I will keep it as a separate package pending your preference on whether it should move under this repository or an official SDK repository.
Mpdreamz commentedon Jul 9, 2026
Hey @dull-bird thank you for discovering this effort so early and contributing the first python integration ❤️ !
I would be over the moon to host it under this organization, let's make that happen.
Mpdreamz commentedon Jul 9, 2026
I think for long term governance it be nice to have it as a separate repository.
cli-schema/python<--- a readme linking to all the python integrationscli-schema/typer | cli-schema/cli-schema-typer<--- for the actual implementation.Than we can have a
pythongithub subteam who can own all the integrations or decide to create its own subteams if we ever cross that bridge?What do you think
dull-bird commentedon Jul 10, 2026
That sounds great — thank you! I agree that a separate repository is the right long-term home for the integration.
My preference would be:
cli-schema/typerfor the GitHub repository;cli-schema-typerfor the Python distribution name;cli-schema/pythonas a lightweight landing page that links to the available Python integrations and documents the shared conventions.I would keep the direct Click support in the Typer repository for now. Typer compiles its application model into a Click command tree, so both integrations currently share the same exporter and parameter-mapping implementation. Splitting them at this stage would mostly duplicate code. We can always separate them later if their APIs, release cycles, or ownership diverge.
I am happy to transfer the existing repository while preserving its history. Let me know whether you would prefer to create
cli-schema/typerfirst and have me push the repository there, or enable a direct GitHub repository transfer into the organization.After the move, I propose the first official milestone include:
For governance, a Python subteam makes sense as the ecosystem grows. Initially, repository-level maintainers or a small
CODEOWNERSentry may be enough, without making the team structure a blocker for the transfer.Does
cli-schema/typerfor the repository, while retainingcli-schema-typeras the package name, sound good to you?dull-bird commentedon Jul 24, 2026
Hi @Mpdreamz — following up on the transfer, with one small proposal and a status update.
Naming: I'd like to revise my earlier
cli-schema/typersuggestion tocli-schema/py. Yourcli-schema-jsmonorepo (which I only saw after my last comment) sets a nicer convention than what we discussed: one repository per language, with framework integrations as packages inside (packages/commander,packages/zod, ...). Mirroring that for Python keeps the org symmetric:cli-schema/py— repository, monorepo layoutpackages/typer— the integration, PyPI namecli-schema-typer(unchanged); direct Click support lives here too since Typer compiles to a Click treepackages/click,packages/argparse, etc. under the same roof, owned by the Python subteam you proposedI'll restructure
dull-bird/cli-schema-typerinto that layout before the move, so no code changes are needed on your side.To unblock the transfer, whichever is less friction for you — both are a single action:
cli-schema/pyand add me as maintainer on it; I'll push the restructured repository, ordull-bird/cli-schema-typerinto the org and you accept + rename it topy.If you also create the
pythonteam with me as maintainer at the same time, future Python-side work (new integrations, releases) won't need to wait on you.Meanwhile, on the JS side: I've opened cli-schema/cli-schema-js#3, which wires up the spec §4 discovery mechanisms for
@cli-schema/commander— a__schemameta-command served by argv interception before parsing (avoids the single-command routing change I hit on Typer), plus the<binary>.cli-schema.jsonsidecar writer. CI is green locally; the workflow run just needs a first-time-contributor approval when you have a moment.No rush on any of this — I know maintainer time is scarce. Everything above is structured so that one visit from you unblocks everything on my side.
Mpdreamz commentedon Jul 25, 2026
@dull-bird I was going to write something similar :)
I created https://github.com/cli-schema/cli-schema-py and created python team and invited you!
Feel free to shape it as you like into a python monorepo.
I created a pypi account and can work on automating releases through OIDC after that just like we do for the https://github.com/cli-schema/cli-schema-js today.
Thanks for the https://github.com/cli-schema/cli-schema-js PR's will take a look now 👍
dull-bird commentedon Jul 26, 2026
@Mpdreamz accepted the python team invite — thanks again! I've pushed the initial monorepo layout to https://github.com/cli-schema/cli-schema-py:
Mirrors
cli-schema-js: one repo per language, integrations as packages inside. Direct Click support stays colocated with Typer since Typer compiles to a Click tree; we can split intopackages/clicklater if APIs diverge. Tests still pass (4/4) in the new layout.A few things I noticed:
dull-bird/cli-schema-typerarchived + a note in its README pointing to the new home, so existing links redirect. Sound good?release.ymlmodeled oncli-schema-js— or leave it to you if you prefer to set the pattern first.Next on my plate: adding CI (pytest across Python/Click/Typer versions), a meta-schema validation step against
cli-schema/cli-schema, and aCODEOWNERSentry. Let me know if you'd like any of those sequenced differently.Mpdreamz commentedon Aug 19, 2026
@dull-bird so sorry for the delay, holidays and real life kept me quiet. :)
Thanks again, really looking forward to extending this to python !
Mpdreamz commentedon Aug 19, 2026
I have a pypi organization request pending, hopefully I can add you to that as well this week.
dull-bird commentedon Aug 24, 2026
@Mpdreamz no worries — hope the holidays were good!
The first infrastructure batch is now on
cli-schema/cli-schema-py:release.ymlmirrors cli-schema-js — workflow_dispatch → release-drafter → PyPI via OIDC trusted publishing (environmentpypi-publish, bare-SemVer tag injected intopyproject.toml, wheel smoke-tested before upload). Ready for you to connect as a pending trusted publisher on pypi.org whenever the org request clears.@cli-schema/python.The Typer version matrix immediately paid off: Typer ≥ 0.27 vendors its own Click fork (
typer._click), so its core classes no longer subclass Click's and the exporter misclassified every parameter. Fixed by matching both class hierarchies — both Typer lines are green.One thing I cannot do from my side: flipping the repo to public needs admin — either you flip it, or grant the python team admin and I will take care of it. I will archive
dull-bird/cli-schema-typerwith a pointer to the new home right after.Looking forward to the PyPI org invite!
Mpdreamz commentedon Aug 31, 2026
Awesome work @dull-bird, just a note on my end that I am still waiting on pypi org approval.
Mpdreamz commentedon Sep 15, 2026
@dull-bird still waiting! I am going to see if I can email support.