feat: add json output for list and view commands

This commit is contained in:
Romain Bertrand 2026-01-18 11:48:08 +01:00
parent fe23f2fce3
commit 3ccef4e1c6
5 changed files with 192 additions and 52 deletions

12
cmd/json.go Normal file
View file

@ -0,0 +1,12 @@
package cmd
import (
"encoding/json"
"os"
)
func writeJSON(value any) error {
enc := json.NewEncoder(os.Stdout)
enc.SetIndent("", " ")
return enc.Encode(value)
}