def export_roles(
    path: Optional[str] = None, indent: Optional[Union[int, str]] = None
) -> None:
    """Exports roles with permissions and view menus to JSON file"""
    # Cast negative numbers to int (as they are passed as str from CLI)
    cast_indent = cast_int_like_to_int(indent)
    current_app.appbuilder.sm.export_roles(path=path, indent=cast_indent)
Exports roles with permissions and view menus to JSON file
flask_appbuilder/cli.py