-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Problem
Currently output is JSON-only. Humans want pretty tables, scripts want raw values for piping.
Pattern from Go CLI Books
From "Building Modern CLI Applications in Go" (p.250-258):
type OutputFormatter interface {
Format(data interface{}) (string, error)
}
type JSONFormatter struct{}
type TableFormatter struct{}
type RawFormatter struct{}
// Auto-detect based on TTY
if isatty.IsTerminal(os.Stdout.Fd()) {
return TableFormatter{}
}
return JSONFormatter{}Action Items
- Add
--outputflag to root command (json|table|raw) - Create formatters in
internal/output/ - Auto-detect TTY for default mode
- Update all commands to use formatter interface
Examples
secrets status --output json # Structured JSON
secrets status --output table # Pretty tables
secrets status --output raw # Just values
secrets status # Auto: table if TTY, json otherwiseBook References
- Search:
pdf-brain search "output format table json" --fts --expand 2000 - Search:
pdf-brain search "isatty terminal detect" --fts --expand 2000
Priority
P1 - Better UX for both humans and agents
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels