Skip to content

Enhancement: add --output flag for text vs JSON output mode #140

@stumelius

Description

@stumelius

Overview

Currently all commands print raw JSON from the dbt Cloud API. For agentic workflows this is ideal, but human users sometimes want a more readable summary. Adding an --output flag would let the caller choose.

Proposed interface

--output [json|text]   Output format (default: json)
  • json (default): current behaviour — pretty-printed JSON body
  • text: concise human-readable summary (e.g. "Job 42: Do nothing! — SUCCESS")

Why this matters for agents

Agents calling the CLI as a subprocess get back the full JSON today, which is correct. The --output text mode would be for human use only. The default must stay json to avoid breaking existing integrations.

Notes

  • DBT_CLOUD_OUTPUT env var as a fallback would be consistent with other env-var conventions in the project
  • Only high-value commands need a text formatter initially (job get/run, run get)
  • Status/progress messages already go to stderr (Fix stdout pollution: route status messages to stderr #133), so stdout is already clean JSON

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions