betty.cli.commands package¶
Submodules¶
- betty.cli.commands.clear_caches module
- betty.cli.commands.config module
- betty.cli.commands.demo module
- betty.cli.commands.dev_update_translations module
- betty.cli.commands.docs module
- betty.cli.commands.extension_new_translation module
- betty.cli.commands.extension_update_translations module
- betty.cli.commands.generate module
- betty.cli.commands.new module
- betty.cli.commands.new_translation module
- betty.cli.commands.serve module
- betty.cli.commands.update_translations module
Module contents¶
Provide the Command Line Interface.
- betty.cli.commands.COMMAND_REPOSITORY: PluginRepository[Command] = <betty.plugin.proxy.ProxyPluginRepository object>¶
The Command Line Interface command repository.
Read more about CLI command plugins.
- class betty.cli.commands.Command[source]¶
Bases:
Plugin
Define a CLI command plugin.
Read more about CLI command plugins.
- betty.cli.commands.command(name: Callable[..., Coroutine[Any, Any, Any]]) Command [source]¶
- betty.cli.commands.command(name: str | None, **attrs: Any) Callable[[Callable[..., Coroutine[Any, Any, Any]]], click.Command]
- betty.cli.commands.command(name: None = None, **attrs: Any) Callable[[Callable[..., Coroutine[Any, Any, Any]]], click.Command]
- betty.cli.commands.command(name: str | None = None, **attrs: Any) Callable[[Callable[..., Coroutine[Any, Any, Any]]], click.Command]
Mark something a Betty command.
This is almost identical to
asyncclick.command()
.Functions decorated with
@command
may choose to raisebetty.error.UserFacingError
, which will automatically be localized and reraised asasyncclick.ClickException
.Read more about CLI command plugins.
- betty.cli.commands.parameter_callback(f: Callable[Concatenate[_T, _P], _ReturnT], *args: _P.args, **kwargs: _P.kwargs) Callable[[click.Context, click.Parameter, _T], _ReturnT] [source]¶
Convert a callback that takes a parameter (option, argument) value and returns it after processing.
This handles errors so Click can gracefully exit.
- betty.cli.commands.project_option(f: Callable[Concatenate[Project, _P], Coroutine[Any, Any, _ReturnT]]) Callable[_P, Coroutine[Any, Any, _ReturnT]] [source]¶
Decorate a command that requires a
betty.project.Project
.