Added TOON output support, to optimize usage of kingfisher from LLM/agent workflows

This commit is contained in:
Mick Grove 2026-03-15 15:00:59 -07:00
commit 349b8165aa
16 changed files with 316 additions and 9 deletions

View file

@ -15,7 +15,7 @@ pub struct OutputArgs<Format: ValueEnum + Send + Sync + 'static> {
#[arg(global = true, long, short, value_hint = ValueHint::FilePath)]
pub output: Option<PathBuf>,
/// Output format (defaults to `pretty` if not specified)
/// Output format (defaults to `pretty`; use `toon` for LLM/agent integrations)
#[arg(global = true, long, short, default_value = "pretty")]
pub format: Format,
}
@ -50,6 +50,9 @@ pub enum ReportOutputFormat {
/// BSON (binary JSON) format
Bson,
/// TOON format optimized for LLMs and agents
Toon,
/// SARIF format (experimental)
Sarif,

View file

@ -50,7 +50,7 @@ pub struct RevokeArgs {
#[arg(long = "no-builtins", default_value_t = false)]
pub no_builtins: bool,
/// Output format: text or json
#[arg(long, default_value = "text", value_parser = ["text", "json"])]
/// Output format: text, json, or toon (`toon` is recommended for LLMs)
#[arg(long, default_value = "text", value_parser = ["text", "json", "toon"])]
pub format: String,
}

View file

@ -58,7 +58,7 @@ pub struct ValidateArgs {
#[arg(long = "no-builtins", default_value_t = false)]
pub no_builtins: bool,
/// Output format: text or json
#[arg(long, default_value = "text", value_parser = ["text", "json"])]
/// Output format: text, json, or toon (`toon` is recommended for LLMs)
#[arg(long, default_value = "text", value_parser = ["text", "json", "toon"])]
pub format: String,
}