betty.cli.commands package - Betty 0.4.0a3 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
- betty.cli.commands.demo module
- betty.cli.commands.docs module
- betty.cli.commands.generate module
- betty.cli.commands.init_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.cli.commands._CommandRepository object>

  The Command Line Interface command repository.

class betty.cli.commands.Command

  Bases: `Plugin`

  Define a CLI command plugin.

  classmethod click_command() → click.core.Command

    Get the plugin’s Click command.

    Return type:

      `click.core.Command`

  classmethod plugin_description() → betty.locale.localizable.Localizable | None

    Get the human-readable long plugin description.

    Return type:

      `betty.locale.localizable.Localizable` | `None`

  classmethod plugin_id() → str

    Get the plugin ID.

    IDs are unique per plugin type: - A plugin repository MUST at most have a single plugin for any ID. - Different plugin repositories MAY each have a plugin with the same ID.

    Return type:

      `str`

  classmethod plugin_label() → betty.locale.localizable.Localizable

    Get the human-readable short plugin label.

    Return type:

      `betty.locale.localizable.Localizable`

betty.cli.commands.command(f: collections.abc.Callable[[_P], collections.abc.Coroutine[Any, Any, None]]) → collections.abc.Callable[[_P], None]

  Mark something a Betty command.

  Parameters:

    f (`collections.abc.Callable`[[`typing.ParamSpec`(`_P`, bound= `None`)], `collections.abc.Coroutine`[`typing.Any`, `typing.Any`, `None`]])

  Return type:

    `collections.abc.Callable`[[`typing.ParamSpec`(`_P`, bound= `None`)], `None`]

betty.cli.commands.pass_app(f: collections.abc.Callable[[Concatenate[betty.app.App, _P]], None]) → collections.abc.Callable[[_P], None]

  Decorate a command to receive the currently running `betty.app.App` as its first argument.

  Parameters:

    f (`collections.abc.Callable`[[`typing.Concatenate`[`betty.app.App`, `typing.ParamSpec`(`_P`, bound= `None`)]], `None`])

  Return type:

    `collections.abc.Callable`[[`typing.ParamSpec`(`_P`, bound= `None`)], `None`]

betty.cli.commands.pass_project(f: collections.abc.Callable[[Concatenate[betty.project.Project, _P]], None]) → collections.abc.Callable[[_P], None]

  Decorate a command to receive the currently running `betty.project.Project` as its first argument.

  Parameters:

    f (`collections.abc.Callable`[[`typing.Concatenate`[`betty.project.Project`, `typing.ParamSpec`(`_P`, bound= `None`)]], `None`])

  Return type:

    `collections.abc.Callable`[[`typing.ParamSpec`(`_P`, bound= `None`)], `None`]