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
« 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
4"""Defines the `history` command group for the Bijux CLI.
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.
10The `history` command, when run without a subcommand, lists, filters, sorts,
11imports, or exports history entries depending on the flags provided.
13The available subcommands are:
14 * `clear`: Erases all stored command history.
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"""
23from __future__ import annotations
25import typer
27from bijux_cli.commands.history.clear import clear_history
28from bijux_cli.commands.history.service import history
30typer.core.rich = None # type: ignore[attr-defined,assignment]
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)
40history_app.callback(invoke_without_command=True)(history)
41history_app.command("clear")(clear_history)
43__all__ = ["history_app"]