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

10 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 `history` command group for the Bijux CLI. 

5 

6This module serves as the central entry point for all command history 

7management functionality. It aggregates the various subcommands and the root 

8history command into a single `Typer` application. 

9 

10The `history` command, when run without a subcommand, lists, filters, sorts, 

11imports, or exports history entries depending on the flags provided. 

12 

13The available subcommands are: 

14 * `clear`: Erases all stored command history. 

15 

16Exit codes for the subcommands generally follow this pattern: 

17 * `0`: Success. 

18 * `1`: An internal or unexpected error occurred. 

19 * `2`: An invalid argument was provided (e.g., bad format, I/O error). 

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

21""" 

22 

23from __future__ import annotations 

24 

25import typer 

26 

27from bijux_cli.cli.commands.history.clear import clear_history 

28from bijux_cli.cli.commands.history.service import history 

29from bijux_cli.core.runtime import AsyncTyper 

30 

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

32 

33history_app = AsyncTyper( 

34 name="history", 

35 help="Inspect or manage command history.", 

36 rich_markup_mode=None, 

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

38 no_args_is_help=False, 

39) 

40 

41history_app.callback(invoke_without_command=True)(history) 

42history_app.command("clear")(clear_history) 

43 

44__all__ = ["history_app"]