Coverage for /home/runner/work/bijux-cli/bijux-cli/src/bijux_cli/__init__.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.10.4, created at 2025-08-19 23:36 +0000

1# SPDX-License-Identifier: MIT 

2# Copyright © 2025 Bijan Mousavi 

3 

4"""The top-level package for the Bijux CLI application. 

5 

6This module serves as the main public entry point for the `bijux-cli` package. 

7It exposes the key components required for both command-line execution and 

8programmatic integration. 

9 

10The primary exports are: 

11 * `entry_point`: The function used by `console_scripts` to start the CLI. 

12 * `BijuxAPI`: A high-level, synchronous facade for using the CLI's 

13 functionality within other Python applications. 

14 * `version` and `api_version`: The application and plugin API versions. 

15""" 

16 

17from __future__ import annotations 

18 

19from bijux_cli.__main__ import main 

20from bijux_cli.__version__ import api_version, version 

21from bijux_cli.api import BijuxAPI 

22 

23 

24def entry_point() -> int | None: 

25 """The primary entry point for the `console_scripts` definition. 

26 

27 This function calls the main CLI orchestrator and catches `SystemExit` 

28 exceptions to ensure a proper integer exit code is returned to the shell. 

29 

30 Returns: 

31 int | None: The integer exit code of the CLI process. 

32 """ 

33 try: 

34 return main() 

35 except SystemExit as exc: 

36 return int(exc.code or 0) 

37 

38 

39__all__ = ["version", "api_version", "BijuxAPI", "entry_point"]