hbllmutils.entry.dispatch
Command-line interface dispatch module for hbllmutils.
This module provides the main CLI entry point and version information display functionality for the hbllmutils package. It sets up the command-line interface using Click framework and handles version display with author information.
The module contains the following main components:
print_version()- Callback function to display version informationhbllmutils()- Main CLI group entry point
Example:
>>> # Command line usage
>>> # hbllmutils --version
>>> # Hbllmutils, version 0.3.1.
>>> # Developed by HansBug (hansbug@buaa.edu.cn).
print_version
- hbllmutils.entry.dispatch.print_version(ctx: Context, param: Option, value: bool) None[source]
Display version information and exit the CLI application.
This callback function is triggered when the version flag is provided on the command line. It prints the application title, version number, and developer information, then exits the application gracefully.
- Parameters:
ctx (Context) – Click context object containing execution state and configuration
param (Option) – Metadata for the current parameter being processed (version option)
value (bool) – Boolean value indicating whether the version flag was provided
- Returns:
None - function exits the application after printing version info
- Return type:
None
Note
This function is designed to be used as a Click callback and should not be called directly in normal code flow.
Note
The function respects Click’s resilient parsing mode and will not execute during completion or validation phases.
Example:
>>> # This function is automatically called when using CLI >>> # $ hbllmutils --version >>> # Hbllmutils, version 0.3.1. >>> # Developed by HansBug (hansbug@buaa.edu.cn).
hbllmutils
- hbllmutils.entry.dispatch.hbllmutils(*args: t.Any, **kwargs: t.Any) t.Any
Main CLI group entry point for hbllmutils command-line interface.
This function serves as the primary command group for the hbllmutils CLI application. It provides the foundation for all subcommands and handles global options such as version display and help information.
The function is decorated with Click’s group decorator to enable command grouping functionality, allowing subcommands to be registered and executed under the main hbllmutils command.
- Returns:
None - serves as a command group container
- Return type:
None
Note
This function acts as a command group container and does not perform any operations directly. Actual functionality is provided by subcommands registered to this group.
Note
Global options like
--versionand--helpare available at this level and apply to the entire CLI application.Example:
>>> # Display help information >>> # $ hbllmutils --help >>> # Usage: hbllmutils [OPTIONS] COMMAND [ARGS]... >>> # >>> # A Python utility library for streamlined Large Language Model >>> # interactions with unified API and conversation management. >>> # >>> # Options: >>> # -v, --version Show hbllmutils's version information. >>> # -h, --help Show this message and exit.