Skip to main content

Module output

Module output 

Source
Expand description

Centralized stdout/stderr emitters for CLI output formatting. Single point of terminal I/O for the CLI (stdout JSON, stderr human).

All user-visible output must go through this module; direct println! in other modules is forbidden.

Structs§

RecallItem
Individual item returned by the recall query.
RecallResponse
Full response envelope returned by the recall subcommand.
RememberResponse
JSON payload emitted by the remember subcommand.

Enums§

JsonOutputFormat
Restricted JSON-only format for commands that always emit JSON.
OutputFormat
Output format variants accepted by --format CLI flags.

Functions§

emit_error
Emits a localised error message to stderr with the Error:/Erro: prefix.
emit_error_i18n
Emits a bilingual error to stderr honouring --lang or SQLITE_GRAPHRAG_LANG. Usage: output::emit_error_i18n("invariant violated", "invariante violado").
emit_json
Serializes value as pretty-printed JSON and writes it to stdout with a trailing newline.
emit_json_compact
Serializes value as compact (single-line) JSON and writes it to stdout with a trailing newline.
emit_progress
Logs msg as a structured tracing::info! event (does not write to stdout).
emit_progress_i18n
Emits a bilingual progress message honouring --lang or SQLITE_GRAPHRAG_LANG. Usage: output::emit_progress_i18n("Computing embedding...", "Calculando embedding...").
emit_text
Writes msg followed by a newline to stdout and flushes.