Skip to content

blackbull.cli

blackbull.cli

blackbull console-script entry point.

Resolves a module:attribute import path to an ASGI 3.0 callable (typically a :class:blackbull.BlackBull instance, but any ASGI app works) and serves it via :func:blackbull.app.serve.

Usage::

blackbull myapp:app --bind 0.0.0.0:8443 \
          --certfile cert.pem --keyfile key.pem --workers 4

Flags mirror :func:blackbull.app.serve kwargs; anything left unspecified falls back to the matching BB_* environment variable (see :mod:blackbull.env).

This module is registered as the blackbull console script via [project.scripts] in pyproject.toml. The in-Python entry app.run(...) (synchronous) is the preferred path for embedded callers (notebooks, test harnesses, examples/*.py).

main(argv=None)

Entry point invoked by the blackbull console script.

Returns a process exit code. argparse handles --help and invalid-flag exits itself (status 2); application-level errors (bad import path, bind syntax) print to stderr and exit 1.