Service Command API Reference¶
This section documents the internals of the service
command in Bijux CLI.
bijux_cli.commands.memory.service ¶
Implements the root callback for the bijux memory
command group.
This module defines the default action for the bijux memory
command. When invoked without a subcommand, it provides a summary of the transient, in-memory data store, including the number of keys currently set.
Output Contract
- Success:
{"status": "ok", "count": int|None, "message": str}
- Verbose: Adds
{"python": str, "platform": str}
to the payload. - Error:
{"error": str, "code": int}
Exit Codes
0
: Success.1
: An unexpected error occurred (e.g., service unavailable).3
: An ASCII or encoding error was detected in the environment.
memory ¶
memory(
ctx: Context,
quiet: bool = Option(
False, "-q", "--quiet", help=HELP_QUIET
),
verbose: bool = Option(
False, "-v", "--verbose", help=HELP_VERBOSE
),
fmt: str = Option(
"json", "-f", "--format", help=HELP_FORMAT
),
pretty: bool = Option(
True, "--pretty/--no-pretty", help=HELP_NO_PRETTY
),
debug: bool = Option(
False, "-d", "--debug", help=HELP_DEBUG
),
) -> None
Defines the entrypoint for the bijux memory
command group.
This function serves as the main callback. It handles --help
requests and, if no subcommand is invoked, delegates to the memory_summary
function to display the default summary view.
Parameters:
-
ctx
(Context
) –The Typer context for the CLI.
-
quiet
(bool
, default:Option(False, '-q', '--quiet', help=HELP_QUIET)
) –If True, suppresses all output except for errors.
-
verbose
(bool
, default:Option(False, '-v', '--verbose', help=HELP_VERBOSE)
) –If True, includes runtime metadata in the output.
-
fmt
(str
, default:Option('json', '-f', '--format', help=HELP_FORMAT)
) –The output format, "json" or "yaml".
-
pretty
(bool
, default:Option(True, '--pretty/--no-pretty', help=HELP_NO_PRETTY)
) –If True, pretty-prints the output.
-
debug
(bool
, default:Option(False, '-d', '--debug', help=HELP_DEBUG)
) –If True, enables debug diagnostics.
Returns:
-
None
(None
) –
Raises:
-
Exit
–Exits after displaying help text.
Source code in src/bijux_cli/commands/memory/service.py
memory_summary ¶
memory_summary(
ctx: Context,
quiet: bool,
verbose: bool,
fmt: str,
pretty: bool,
debug: bool,
) -> None
Handles the logic for the default bijux memory
command action.
This function is called by the main Typer callback when no subcommand is specified. It resolves the memory service, gets the key count, and then executes the one-shot summary.
Parameters:
-
ctx
(Context
) –The Typer context for the CLI.
-
quiet
(bool
) –If True, suppresses all output except for errors.
-
verbose
(bool
) –If True, includes Python/platform details in the output.
-
fmt
(str
) –The output format, "json" or "yaml".
-
pretty
(bool
) –If True, pretty-prints the output.
-
debug
(bool
) –If True, enables debug diagnostics.
Returns:
-
None
(None
) –
Raises:
-
SystemExit
–Always exits with a contract-compliant status code and payload upon completion or error.