Locate an installed open_pdks-layout PDK (open_pdks, volare, or ciel) and
report its root, variant, version stamp, and per-tool asset directories as
structured data. This is the one shared PDK_ROOT resolver every downstream
tool imports instead of re-implementing the lookup. Fully headless; safe in
CI.

positional arguments:
  <subcommand> find resolve one PDK install/variant and report its paths list enumerate every PDK install and variant discovered env emit the resolved paths as eval-able shell exports check resolve one PDK install/variant and flag dangling symlinks cells report standard-cell library device flavor(s) / nominal supply macros report hard-macro IP libraries (`*_fd_ip_*` or lef+lib) and their views decks list the KLayout DRC decks a PDK ships and the -rd globals each reads corners report SPICE process corners and which device families they skew em-limits report per-layer electromigration current-density limits pcell-check probe whether the resolved variant's own KLayout PCell packages are importable here stackup report the variant's process cross-section (elevation, thickness, permittivity, conductivity)

options:
  -h, --help show this help message and exit

--- klt pdk find ---

Resolve a single PDK install and variant via the documented resolution order
and emit its root, variant, version, how it was resolved, and its per-tool
asset directories.

options:
  -h, --help show this help message and exit
  --pdk PDK variant to resolve (e.g. sky130A); overrides $PDK
  --pdk-root PDK_ROOT explicit install root; overrides $PDK_ROOT and the search order
  --expect-version STAMP_OR_SHA assert the installed PDK identity: an open_pdks commit SHA (>= 7 hex) or SOURCES stamp, or a fetched-version string. Exit 6 (payload still emitted) on mismatch or unknown identity
  --format {text,json} output format (default: text)

--- klt pdk list ---

Enumerate every install and variant found across the full search order. An
empty result is success (exit 0), not an error.

options:
  -h, --help show this help message and exit
  --pdk-root PDK_ROOT restrict the scan to this install root
  --format {text,json} output format (default: text)

--- klt pdk env ---

Emit the resolved install as shell `export` lines (`eval "$(klt pdk env)"`) so
an interactive simulator or schematic-editor session uses the same install the
automated tooling picked. --format json emits the same payload as `find`.

options:
  -h, --help show this help message and exit
  --pdk PDK variant to resolve (e.g. sky130A); overrides $PDK
  --pdk-root PDK_ROOT explicit install root; overrides $PDK_ROOT and the search order
  --format {text,json} output format (default: text; text emits shell exports)

--- klt pdk check ---

Resolve a single PDK install/variant (same paths `find` emits) and
additionally exit non-zero when any of its asset directories contain a
dangling symlink -- a symlink whose target does not exist, e.g. a standalone
`ihp-sg13cmos5l` install whose xschem device symbols are relative symlinks
into a sibling `ihp-sg13g2` checkout the install does not contain.
`find`/`list` already resolve such an install (it looks complete on disk);
`check` is the scriptable CI gate that catches part of it being unusable.

options:
  -h, --help show this help message and exit
  --pdk PDK variant to resolve (e.g. sky130A); overrides $PDK
  --pdk-root PDK_ROOT explicit install root; overrides $PDK_ROOT and the search order
  --expect-version STAMP_OR_SHA assert the installed PDK identity: an open_pdks commit SHA (>= 7 hex) or SOURCES stamp, or a fetched-version string. Exit 6 (payload still emitted) on mismatch or unknown identity
  --format {text,json} output format (default: text)

--- klt pdk cells ---

Report, per standard-cell digital library (libs.ref entries named `*_fd_sc_*`
or `*_stdcell*`) under the resolved variant: the nfet/pfet device flavor(s)
its cells instantiate (spice/<lib>.spice), and the nominal supply its .lib
timing views are characterised at. With --supply, adds a per-library
compatibility verdict and exits non-zero (3) when no library matches, so this
can gate CI.

options:
  -h, --help show this help message and exit
  --pdk PDK variant to resolve (e.g. sky130A); overrides $PDK
  --pdk-root PDK_ROOT explicit install root; overrides $PDK_ROOT and the search order
  --supply SUPPLY caller-stated supply in volts; adds a compatibility verdict per library and exits 3 when no library is compatible
  --format {text,json} output format (default: text)

--- klt pdk macros ---

Report, per hard-macro IP library (libs.ref entries named `*_fd_ip_*`, or ones
shipping both `lef` and `lib` views such as IHP's `sg13g2_sram`; e.g. an
SRAM/ROM compiler output) under the resolved variant: which views it ships
(GDS, LEF, Liberty (`lib`), CDL, SPICE, Verilog). This is the sibling command
to `klt pdk cells`, which deliberately excludes these libraries -- see `klt
pdk cells --help`.

options:
  -h, --help show this help message and exit
  --pdk PDK variant to resolve (e.g. sky130A); overrides $PDK
  --pdk-root PDK_ROOT explicit install root; overrides $PDK_ROOT and the search order
  --format {text,json} output format (default: text)

--- klt pdk decks ---

List the `.lydrc`/`.drc` KLayout DRC deck files under the resolved variant's
libs.tech/klayout/drc, which one `klt drc --pdk` runs (`is_default`), and a
best-effort static scan of the `-rd` globals each consumes
(`required_by_caller`, `default`). Use it to pick a sibling deck for `klt drc
--deck-file` and the `--deck-var` flags it needs.

options:
  -h, --help show this help message and exit
  --pdk PDK variant to resolve (e.g. sky130A); overrides $PDK
  --pdk-root PDK_ROOT explicit install root; overrides $PDK_ROOT and the search order
  --format {text,json} output format (default: text)

--- klt pdk corners ---

Report, for the resolved variant's golden ngspice model deck: the available
top-level SPICE process corner names, and per corner, which curated device
families (mos/bjt/diode/resistor/mim_cap/mos_cap for gf180mcu;
mos/resistor_cap for sky130) resolve to a skewed section, a param-driven skew
on a shared model, or the typical section. `complete` flags a corner that
leaves one or more families at typical -- the silent-typical bug this command
exists to surface.

options:
  -h, --help show this help message and exit
  --pdk PDK variant to resolve (e.g. gf180mcuD); overrides $PDK
  --pdk-root PDK_ROOT explicit install root; overrides $PDK_ROOT and the search order
  --format {text,json} output format (default: text)

--- klt pdk em-limits ---

Parse every tech LEF the resolved variant ships (every libs_ref entry with a
techlef/ directory, whatever its naming convention -- not just _fd_sc_-named
standard-cell libraries) and report, per ROUTING/CUT layer, the
DCCURRENTDENSITY/ACCURRENTDENSITY limits declared -- flagging any layer where
the shipped tech LEFs disagree, and returning the conservative (lower) value
by default. A cut/via layer with no declared current density (e.g. a
diffusion/poly contact layer) is reported with an explicit 'not shipped'
result rather than being silently omitted.

options:
  -h, --help show this help message and exit
  --pdk PDK variant to resolve (e.g. gf180mcuD); overrides $PDK
  --pdk-root PDK_ROOT explicit install root; overrides $PDK_ROOT and the search order
  --format {text,json} output format (default: text)

--- klt pdk pcell-check ---

Attempt to import every KLayout PyCell package the resolved variant ships
under `libs.tech/klayout/python/` and report which ones loaded (with their
library/cell names) vs. which are unavailable here and why -- naming the
missing Python module for a genuinely missing third-party dependency, and
flagging a vendored git-submodule directory that checked out empty (a release
tarball install that omits submodule contents) with a dedicated, actionable
reason. This is the same probe `klt gen --list-pdk-pcells` already computes
(issue #1535), surfaced here so a caller checking PDK health does not need to
invoke `klt gen` at all. A PDK shipping no PyCell library at all is still exit
0 -- there is nothing to import.

options:
  -h, --help show this help message and exit
  --pdk PDK variant to resolve (e.g. ihp-sg13g2); overrides $PDK
  --pdk-root PDK_ROOT explicit install root; overrides $PDK_ROOT and the search order
  --format {text,json} output format (default: text)

--- klt pdk stackup ---

Emit the resolved variant's process stack-up as structured data -- the z-axis
information a GDSII/OASIS file does not carry and an external E&M/field solver
requires. Per conductor/via layer: elevation (z0/z1), thickness, sheet
resistance (or per-cut resistance) and derived conductivity; per dielectric:
z-range and relative permittivity. Thickness and resistance are parsed live
out of the install's own tech LEFs at the selected parasitic corner; elevation
and permittivity are not stated in any tech LEF and come from a curated per-
family table whose published, open sources each entry cites (see
`curated_source.references`). A variant whose family has no curated entry is
an explicit error, not a partial stack.

options:
  -h, --help show this help message and exit
  --pdk PDK variant to resolve (e.g. sky130A); overrides $PDK
  --pdk-root PDK_ROOT explicit install root; overrides $PDK_ROOT and the search order
  --corner CORNER tech-LEF parasitic corner to read thickness/resistance from (default: nom); real sky130 installs ship min/nom/max and their sheet resistances differ by corner
  --thickness {curated,tech-lef} which published film thickness drives the emitted geometry (default: curated). `curated` keeps the stack gap-free (each level's z1 is exactly the next level's z0); `tech-lef` uses the install's own declared THICKNESS, which in real sky130 installs is ~10 nm thinner and so leaves each metal short of the via above it. Both readings are reported either way (curated_thickness_um / lef_thickness_um)
  --format {text,json} output format (default: text)
