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

18 statements  

« prev     ^ index     » next       coverage.py v7.13.2, created at 2026-01-26 17:59 +0000

1# SPDX-License-Identifier: Apache-2.0 

2# Copyright © 2025 Bijan Mousavi 

3 

4"""Defines the `plugins` command group for the Bijux CLI. 

5 

6This module serves as the central entry point for all plugin management 

7functionality. It aggregates the various subcommands into a single `Typer` 

8application, creating the `bijux plugins` command hierarchy. 

9 

10This command group does not have a default action and requires a subcommand 

11to be specified. 

12 

13The available subcommands are: 

14 * `scaffold`: Creates a new plugin project from a `cookiecutter` template. 

15 * `install`: Installs a plugin from a local source directory. 

16 * `uninstall`: Removes an installed plugin. 

17 * `list`: Lists all installed plugins. 

18 * `info`: Displays detailed metadata for a specific plugin. 

19 * `check`: Runs a health check on an installed plugin. 

20 

21Exit codes for the subcommands generally follow this pattern: 

22 * `0`: Success. 

23 * `1`: An internal error or command failure occurred. 

24 * `2`: An invalid argument or format was provided. 

25 * `3`: An ASCII or encoding error was detected. 

26""" 

27 

28from __future__ import annotations 

29 

30import typer 

31 

32from bijux_cli.cli.plugins.commands.check import check_plugin 

33from bijux_cli.cli.plugins.commands.info import info_plugin 

34from bijux_cli.cli.plugins.commands.install import install_plugin 

35from bijux_cli.cli.plugins.commands.list import list_plugin 

36from bijux_cli.cli.plugins.commands.scaffold import scaffold_plugin 

37from bijux_cli.cli.plugins.commands.uninstall import uninstall_plugin 

38from bijux_cli.core.runtime import AsyncTyper 

39 

40typer.core.rich = None # type: ignore[attr-defined] 

41 

42plugins_app = AsyncTyper( 

43 name="plugins", 

44 help="Manage Bijux CLI plugins", 

45 rich_markup_mode=None, 

46 context_settings={"help_option_names": ["-h", "--help"]}, 

47 no_args_is_help=False, 

48) 

49 

50plugins_app.command("scaffold")(scaffold_plugin) 

51plugins_app.command("install")(install_plugin) 

52plugins_app.command("uninstall")(uninstall_plugin) 

53plugins_app.command("list")(list_plugin) 

54plugins_app.command("info")(info_plugin) 

55plugins_app.command("check")(check_plugin) 

56 

57 

58__all__ = [ 

59 "plugins_app", 

60]