Skip to content

Latest commit

 

History

History
60 lines (34 loc) · 4.17 KB

File metadata and controls

60 lines (34 loc) · 4.17 KB
graph LR
    Command_Base_Executor["Command Base & Executor"]
    Command_Argument_Definition_Processor["Command & Argument Definition Processor"]
    Command_Discovery_Loader["Command Discovery & Loader"]
    Command_Registry["Command Registry"]
    Command_Argument_Definition_Processor -- "defines structure for" --> Command_Base_Executor
    Command_Base_Executor -- "relies on definitions from" --> Command_Argument_Definition_Processor
    Command_Discovery_Loader -- "leverages introspection from" --> Command_Argument_Definition_Processor
    Command_Discovery_Loader -- "populates" --> Command_Registry
    Command_Registry -- "manages instances of" --> Command_Base_Executor
    Command_Registry -- "provides access to" --> Command_Base_Executor
Loading

CodeBoardingDemoContact

Details

The Command Definition & Registry subsystem is a cornerstone of the nubia CLI framework, responsible for the declarative definition, discovery, and centralized management of all available commands and their associated metadata. This subsystem embodies the framework's architectural bias towards modularity, extensibility, and declarative command definition.

Command Base & Executor

Establishes the fundamental structure and behavior for all commands. It defines the base class (Command) that all user-defined commands inherit from, providing common attributes (e.g., help text, subcommands) and orchestrating the execution flow. It acts as the runtime representation of a command. This component is crucial as it provides the concrete foundation upon which all commands are built and executed.

Related Classes/Methods:

Command & Argument Definition Processor

Offers a declarative API, primarily through decorators, for defining commands and their arguments. nubia.internal.typing handles type conversions and validation for arguments, ensuring robust input processing. nubia.internal.options defines the structure or decorators for command-line options and flags. This component is vital for enabling the declarative and extensible nature of command definition, a key architectural pattern.

Related Classes/Methods:

Command Discovery & Loader

Scans specified packages and modules to locate and load command definitions. It identifies classes decorated as commands and prepares them for instantiation and registration. This component is essential for the plugin/extension pattern, allowing new commands to be dynamically added to the CLI.

Related Classes/Methods:

Command Registry

Functions as the central, searchable repository for all loaded and registered commands. It maintains a collection of command objects and their associated metadata, enabling other parts of the system to efficiently query and retrieve command information. This component is fundamental for the Command Pattern, providing a centralized lookup mechanism for command dispatch.

Related Classes/Methods: