Skip to content

Return JSON errors when --json flag is set #8

Description

@mcheemaa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions