betty.cli.commands package - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.cli.commands package

## Submodules

- betty.cli.commands.clear_caches module
  - `ClearCaches`
    - `ClearCaches.__init__()`
    - `ClearCaches.click_command()`
    - `ClearCaches.new_for_app()`
- betty.cli.commands.config module
  - `Config`
    - `Config.__init__()`
    - `Config.click_command()`
    - `Config.new_for_app()`
- betty.cli.commands.demo module
  - `Demo`
    - `Demo.__init__()`
    - `Demo.click_command()`
    - `Demo.new_for_app()`
- betty.cli.commands.dev_update_translations module
  - `DevUpdateTranslations`
    - `DevUpdateTranslations.__init__()`
    - `DevUpdateTranslations.click_command()`
    - `DevUpdateTranslations.new_for_app()`
- betty.cli.commands.docs module
  - `Docs`
    - `Docs.__init__()`
    - `Docs.click_command()`
    - `Docs.new_for_app()`
- betty.cli.commands.extension_new_translation module
  - `ExtensionNewTranslation`
    - `ExtensionNewTranslation.__init__()`
    - `ExtensionNewTranslation.click_command()`
    - `ExtensionNewTranslation.new_for_app()`
- betty.cli.commands.extension_update_translations module
  - `ExtensionUpdateTranslations`
    - `ExtensionUpdateTranslations.__init__()`
    - `ExtensionUpdateTranslations.click_command()`
    - `ExtensionUpdateTranslations.new_for_app()`
- betty.cli.commands.generate module
  - `Generate`
    - `Generate.__init__()`
    - `Generate.click_command()`
    - `Generate.new_for_app()`
- betty.cli.commands.new module
  - `New`
    - `New.__init__()`
    - `New.click_command()`
    - `New.new_for_app()`
- betty.cli.commands.new_translation module
  - `NewTranslation`
    - `NewTranslation.__init__()`
    - `NewTranslation.click_command()`
    - `NewTranslation.new_for_app()`
- betty.cli.commands.serve module
  - `Serve`
    - `Serve.__init__()`
    - `Serve.click_command()`
    - `Serve.new_for_app()`
- betty.cli.commands.update_translations module
  - `UpdateTranslations`
    - `UpdateTranslations.__init__()`
    - `UpdateTranslations.click_command()`
    - `UpdateTranslations.new_for_app()`

## 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

  Bases: `Plugin`

  Define a CLI command plugin.

  Read more about CLI command plugins.

  abstractmethod async click_command() → Command

    Get the plugin’s Click command.

betty.cli.commands.command(name: Callable[..., Coroutine[Any, Any, Any]]) → Command
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 raise `betty.error.UserFacingError`, which will automatically be localized and reraised as `asyncclick.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]

  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]]

  Decorate a command that requires a `betty.project.Project`.