INNER CODE UNIT · Python
main
ohdearquant/lionagi · lionagi/cli/main.py:496
def main(argv: list[str] | None = None) -> int:
"""Entry point for the ``li`` console script.
Wraps the real implementation so that a missing dependency is reported as a
broken environment rather than as a failed run, but only where that is
actually true. A lazily imported module can go missing after a command has
already allocated a run, and there a run id, a run directory and a manifest
exist on disk; calling that an unusable environment would tell the caller
nothing was executed while durable state sits in the runs directory. So the
allocation marker decides, and once a run exists the error is left to
propagate and be reported the way any other failure during a run is.
"""
begin_invocation()
try:
return _run(argv)
except ModuleNotFoundError as exc:
if run_was_allocated():
raise