Skip to content

Provium CLI API reference

The public API exported by provium.cli.

provium.cli

Provium's command-line interface and command plugin system.

CLI_PLUGIN_API_VERSION = 1 module-attribute

The CLI plugin API version supported by this Provium release.

CLI_PLUGIN_ENTRY_POINT_GROUP = 'provium.cli.command_catalogs' module-attribute

The packaging entry-point group used to publish CLI plugins.

__version__ = version('provium') module-attribute

__all__ = ['CLI_PLUGIN_API_VERSION', 'CLI_PLUGIN_ENTRY_POINT_GROUP', 'CLIPlugin', 'Command', 'CommandCatalog', '__version__', 'create_parser', 'discover_command_catalogs', 'main', 'reset_command_discovery', 'run'] module-attribute

CommandCatalog

Register and look up concrete command classes by name.

commands property

A read-only view of the registered commands.

register(command)

Register a command class and return it.

resolve(name)

Return the command class registered under a name.

Command

Bases: ABC

A command that can configure arguments and execute them.

configure(parser) abstractmethod

Configure the command's arguments.

execute(arguments) abstractmethod

Execute the command and return its process exit code.

CLIPlugin dataclass

A versioned command catalog published by an installed distribution.

create_parser(catalog)

Create a parser containing the commands in a catalog.

main()

Run the command-line interface with the process arguments.

run(arguments, *, catalog=None)

Parse arguments and execute the selected command.

discover_command_catalogs()

Return the combined built-in and installed command catalog.

reset_command_discovery()

Clear the cached discovered catalog.