Source code for collective.html2blocks.cli_app

"""
Typer application for the ``html2blocks`` command.

This module builds the Typer-based command-line interface for converting HTML
content to Volto blocks, inspecting conversion info, and running the API server.
It needs the ``cli`` extra. The ``html2blocks`` script loads it through
:mod:`collective.html2blocks.cli`, which reports the missing extra.

Example:
    .. code-block:: shell

        uv run html2blocks convert input.html
        uv run html2blocks info
        uv run html2blocks server
"""

from collective.html2blocks.commands.convert import app as app_convert
from collective.html2blocks.commands.info import app as app_info
from collective.html2blocks.commands.server import app as app_server

import typer


app = typer.Typer(no_args_is_help=True)


[docs] @app.callback(invoke_without_command=True) def main(ctx: typer.Context): """ Main CLI callback for ``collective.html2blocks``. This function is invoked when the CLI is run without a subcommand. It displays a welcome message and help information for available commands. Args: ctx (typer.Context): Typer context object. Example: .. code-block:: shell $ uv run html2blocks Welcome to collective.html2blocks. """ pass
app.add_typer(app_convert) app.add_typer(app_info) app.add_typer(app_server) __all__ = ["app"]