class efiboot.cli.command(fn)#

A decorator for CLI command functions.

The efiboot CLI is built from command objects. Command objects are implemented as regular functions annotated with the @command decorator. The docstrings of these functions are written in docopt format, which is used to generate the argv parser.

All commands take an argument dictionary as their first argument and a Config as a keyword argument. They return an integer exit code.

When calling a command object, you may pass a list of strings instead of an argument dict. In this case, the list will be parsed as an argv list using docopt and converted into an args dictionary.

See also

See the module-level docs for information on how to register efiboot commands from third-party packages.


from efiboot import EfiBoot
from efiboot.cli import command
from efiboot.config import Config

def status(args: Dict[str, Any], config: Config) -> int:
    """Print EFI boot entries.

        efiboot status
        efiboot status --help

        -h, --help    Print this help message and exit.
    facade = EfiBoot(config)
    return 0



Initialize the command object.



The first line of the usage string.


The usage string for the command.