Skip to main content

Module output

Module output 

Source
Expand description

Terminal output formatting.

This is the only module allowed to call println! or eprintln!.

Functions§

confirm_clear
Asks for interactive confirmation before clearing all keys.
emit_ndjson
Emits an NDJSON event (one JSON line) to stdout.
format_added_at_display
Formats an RFC3339 string for compact display: YYYY-MM-DD HH:MM:SS.
health_symbol
Returns a colored check/cross symbol for health check results.
print_config_path
Prints a file path to stdout.
print_documentation_formatted
Prints structured documentation from the docs endpoint.
print_empty_json_array
Prints an empty JSON array [] to stdout.
print_exported_key
Prints a key in CONTEXT7_API=<value> format to stdout.
print_health_line
Prints a health check status line to stdout, respecting --quiet.
print_import_completed
Prints the success message for keys import.
print_invalid_empty_key
Displays an error when the user tries to add an empty API key.
print_invalid_index
Prints an invalid index error.
print_json_results
Prints raw JSON results to stdout (used by Library and Docs JSON mode).
print_key_added
Prints the success message for keys add.
print_key_already_existed
Prints the warning message when a key already exists (dedupe).
print_key_format_warning
Displays a warning when the key does not match the expected ctx7sk- format.
print_key_removed
Prints the success message for keys remove.
print_keys_removed
Prints the success message for keys clear.
print_libraries_formatted
Prints the list of libraries returned by the search endpoint.
print_library_not_found_hint
Prints a user-friendly hint when the requested library was not found.
print_masked_keys
Prints all stored keys with 1-based indices and masked values.
print_no_keys
Prints the “no keys stored” hint message.
print_no_keys_to_remove
Prints the “no keys to remove” message.
print_operation_cancelled
Prints the cancellation message for keys clear.
print_plain_text
Prints plain text to stdout (used by Docs text mode).
print_raw_json
Prints a raw JSON string to stdout.
print_xdg_unsupported
Prints an “XDG not supported” error for keys path.
set_quiet
Enables or disables stdout suppression (--quiet flag).