-
Notifications
You must be signed in to change notification settings - Fork 738
Open
Description
Problem
Currently all error output from gws is raw JSON, which is hard to read in an interactive terminal session:
{"error":{"code":404,"message":"Not Found","reason":"notFound"}}Proposal
Detect whether stdout/stderr is a TTY and display human-friendly colored messages when running interactively:
✗ notFound (404): Not Found ← red bold
⚠️ Model Armor: injection detected ← yellow bold
💡 API not enabled for your project ← yellow bold
When piped or redirected, keep the existing JSON output for backward compatibility.
Implementation notes
- Use
std::io::IsTerminal(stable since Rust 1.70) for TTY detection coloredcrate (or alternativelyanstream/anstylewhich are already indirect deps via clap) for ANSI colors- Error output goes to stderr; JSON pipe output stays on stdout
- Zero behavior change for scripted/piped usage
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels