specter icon indicating copy to clipboard operation
specter copied to clipboard

Return JSON errors when --json flag is set

Open mcheemaa opened this issue 8 months ago • 0 comments

When a command fails with the --json flag, errors are returned as plain text instead of structured JSON. For example:

specter destroy nonexistent --json --yes
# Returns: agent 'nonexistent' not found in local state
# Should return: {"error": "agent 'nonexistent' not found in local state"}

This breaks the agent-native promise. Any AI agent parsing --json output will get unexpected plain text on errors.

mcheemaa avatar Mar 23 '26 20:03 mcheemaa