Delete Command API Reference¶
This section documents the internals of the delete
command in Bijux CLI.
bijux_cli.commands.memory.delete ¶
Implements the memory delete
subcommand for the Bijux CLI.
This module contains the logic for removing a specific key and its associated value from the transient, in-memory data store. It provides a structured, machine-readable confirmation of the deletion.
Output Contract
- Success:
{"status": "deleted", "key": str}
- Verbose: Adds
{"python": str, "platform": str}
to the payload. - Error:
{"error": str, "code": int}
Exit Codes
0
: Success.1
: The key was not found, or another unexpected error occurred.2
: The provided key was invalid.
delete_memory ¶
delete_memory(
key: str = Argument(..., help="Key to delete"),
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
Deletes a key from the transient in-memory store.
This command validates the key's format and then removes the corresponding key-value pair from the memory service.
Parameters:
-
key
(str
, default:Argument(..., help='Key to delete')
) –The memory key to remove. Must be between 1 and 4096 printable, non-whitespace characters.
-
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 an error.