Version Command API Reference¶
This section documents the internals of the version
command in Bijux CLI.
bijux_cli.commands.version ¶
Implements the version
command for the Bijux CLI.
This module reports the CLI's version and runtime environment information. The output is machine-readable, available in JSON or YAML, and is designed to be safe for automation and scripting by adhering to a strict output contract and ASCII hygiene.
Output Contract
- Success:
{"version": str}
- Verbose: Adds
{"python": str, "platform": str, "timestamp": float}
. - Error:
{"error": str, "code": int}
Exit Codes
0
: Success.1
: Internal or fatal error.2
: CLI argument, flag, or format error.3
: ASCII or encoding error.
version ¶
version(
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 and logic for the bijux version
command.
This function orchestrates the version reporting process by validating flags and then using the shared new_run_command
helper to build and emit the final 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; the exit code is the primary indicator of the outcome.
-
verbose
(bool
, default:Option(False, '-v', '--verbose', help=HELP_VERBOSE)
) –If True, includes Python, platform, and timestamp details in the output payload.
-
fmt
(str
, default:Option('json', '-f', '--format', help=HELP_FORMAT)
) –The output format, either "json" or "yaml". Defaults to "json".
-
pretty
(bool
, default:Option(True, '--pretty/--no-pretty', help=HELP_NO_PRETTY)
) –If True, pretty-prints the output for human readability.
-
debug
(bool
, default:Option(False, '-d', '--debug', help=HELP_DEBUG)
) –If True, enables debug diagnostics, implying
verbose
andpretty
.
Returns:
-
None
(None
) –
Raises:
-
SystemExit
–Always exits with a contract-compliant status code and payload upon completion or error.