List_cmd Command API Reference¶
This section documents the internals of the list_cmd
command in Bijux CLI.
bijux_cli.commands.config.list_cmd ¶
Implements the config list
subcommand for the Bijux CLI.
This module contains the logic for listing all keys currently defined in the active configuration store. It retrieves the keys and presents them in a structured, machine-readable list format.
Output Contract
- Success:
{"items": [{"key": str}, ...]}
- Verbose: Adds
{"python": str, "platform": str}
to the payload. - Error:
{"error": str, "code": int}
Exit Codes
0
: Success.1
: An unexpected error occurred while accessing the configuration.
list_config ¶
list_config(
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
Lists all configuration keys from the active configuration store.
This function retrieves all defined keys, sorts them, and then uses the new_run_command
helper to emit them in a structured payload.
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 Python/platform details 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:
-
SystemExit
–Always exits with a contract-compliant status code and payload, indicating success or detailing the error.