PrintJSONCompact prints any value as compact (no-indent) JSON — a single line plus trailing newline. Preferred for machine-consumed payloads where pretty-print whitespace is pure overhead (e.g. `pad bootstrap`, whose canonical consumer is the /pad agent skill). Human inspection has the --format mark
(v interface{})
| 429 | // canonical consumer is the /pad agent skill). Human inspection has the |
| 430 | // --format markdown variant. |
| 431 | func PrintJSONCompact(v interface{}) error { |
| 432 | enc := json.NewEncoder(os.Stdout) |
| 433 | return enc.Encode(v) |
| 434 | } |
| 435 | |
| 436 | // PrintItemMeta prints item metadata header with colors. |
| 437 | func PrintItemMeta(item *models.Item) { |