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

9 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"""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.commands.history.clear import clear_history 

28from bijux_cli.commands.history.service import history 

29 

30typer.core.rich = None # type: ignore[attr-defined,assignment] 

31 

32history_app = typer.Typer( # pytype: skip-file 

33 name="history", 

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

35 rich_markup_mode=None, 

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

37 no_args_is_help=False, 

38) 

39 

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

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

42 

43__all__ = ["history_app"]