specter
specter copied to clipboard
Return JSON errors when --json flag is set
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.