Skip to main content

cli_engine/output/
mod.rs

1//! Structured output envelopes and renderers.
2//!
3//! Command handlers return JSON-serializable data and a backend system id. The
4//! middleware wraps that data in an [`Envelope`], applies filtering, pagination,
5//! JMESPath expressions, field projection, and then renders the result as JSON,
6//! human text, or TOON.
7//!
8//! JSON is the default for the Rust crate. Human output is intended for terminal
9//! readability, and TOON remains available as an explicit migration format.
10
11mod envelope;
12mod fields;
13mod human;
14mod json;
15mod pipeline;
16mod renderer;
17mod schema;
18mod toon;
19
20pub use crate::error::{DetailedError, ExitCoder, exit_code_for_error, exit_code_for_exit_coder};
21pub use envelope::{
22    Envelope, ErrorEnvelope, Metadata, NextAction, NextActionParam, PaginationMeta,
23    build_detailed_error_envelope, build_error_envelope,
24};
25pub use fields::{FieldTree, filter_fields, parse_fields};
26pub use human::{
27    HumanViewDef, HumanViewFn, HumanViewRegistry, HumanViewRenderer, TableColumn,
28    global_human_view_registry_snapshot, lookup_global_human_view_columns,
29    lookup_global_human_view_func, register_global_human_view, register_global_human_view_func,
30    render_human, render_human_with_registry, render_human_with_registry_for_schema,
31    render_human_with_view,
32};
33pub use json::render_json;
34pub use pipeline::{PipelineOpts, apply_pipeline};
35pub use renderer::{
36    OutputFormat, RendererFactory, is_valid_output_format, render, render_data, render_data_format,
37    render_detailed_error, render_detailed_error_format, render_error, render_error_format,
38    render_format, write_render,
39};
40pub use schema::{
41    FieldInfo, OutputField, OutputSchema, SchemaInfo, SchemaRegistry, fields_for,
42    fields_from_json_schema, format_help_section, get_global_schema_by_path,
43    global_schema_registry_snapshot, json_schema_for, json_schema_info,
44    register_global_json_schema, register_global_schema, register_global_schema_fields,
45    register_global_schema_info,
46};
47pub use toon::render_toon;