Skip to content

Provium CLI API reference

The public API exported by provium.cli.

All registered commands and groups receive the repeatable --config KEY.PATH=VALUE option from the core parser. Command implementations obtain merged settings lazily with self.configuration(arguments); shared helpers can use command_configuration(arguments). Reserve --config for application overrides when declaring custom command options. See Configuration for environment variables, value types, and precedence.

Configuration helpers

provium.cli.configuration.command_configuration(arguments, *, environment_aliases=None)

Load files and environment, then apply overrides in command-line order.

provium.cli.configuration.configure_configuration(parser)

Give each parser a separate destination so nested options accumulate.

CLI exports

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', 'CommandGroup', '__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.

configuration(arguments)

Load application settings only when this command needs them.

execute(arguments) abstractmethod

Execute the command and return its process exit code.

CommandGroup

Bases: Command

A command whose catalog contains leaf commands or further groups.

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.