echo '{"foo":[{"bar":1}]}' | jq '.' -C | less -R
みたいな感じでやる。
$ man jq
--color-output / -C and --monochrome-output / -M:
By default, jq outputs colored JSON if writing to a terminal. You can force it to produce color even if writing to a pipe or a file
using -C, and disable color with -M.
的な感じで色付きでパイプさせて
$ man less
-R or --RAW-CONTROL-CHARS
Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained cor-
rectly in most cases. ANSI "color" escape sequences are sequences of the form:
ESC [ ... m
where the "..." is zero or more color specification characters For the purpose of keeping track of screen appearance, ANSI color
escape sequences are assumed to not move the cursor. You can make less think that characters other than "m" can end ANSI color
escape sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color escape
sequence. And you can make less think that characters other than the standard ones may appear between the ESC and the m by set-
ting the environment variable LESSANSIMIDCHARS to the list of characters which can appear.
的な感じで色付きで受け取る