Skip to content

main

main

CLI entry point for terok-clearance-hub — desktop notification tools.

Wires the COMMANDS registry into argparse via CommandTree. Passing the process argv into wire makes dispatch lazy: only the invoked verb's module is imported, so terok-clearance-hub notify pays for none of the hub / verdict / Textual verbs.

main()

Entry point for terok-clearance-hub.

Source code in src/terok_clearance/cli/main.py
def main() -> None:
    """Entry point for ``terok-clearance-hub``."""
    argv = sys.argv[1:]
    parser = argparse.ArgumentParser(
        prog="terok-clearance-hub",
        description="Desktop notification tools for the terok ecosystem.",
    )
    CommandTree(COMMANDS).wire(parser, argv=argv)

    args = parser.parse_args(argv)
    if not hasattr(args, "_cmd"):
        parser.print_help()
        raise SystemExit(2)

    try:
        CommandTree.dispatch(args)
    except KeyboardInterrupt:
        raise SystemExit(130) from None