Skip to content

Add consistent --output json support to all tkn commands #2850

@vdemeester

Description

@vdemeester

Summary

Not all tkn commands support --output json. This makes it unreliable for AI agents and scripts that need machine-readable output.

Current State

  • start --dry-run supports --output json/yaml
  • list commands use Go template tables, some support --output via PrintObjects
  • describe commands have custom formatted output, some support --output via PrintObjectV1
  • logs, delete, cancel have no structured output

Proposal

  1. Add --output json and --output yaml to every command that produces output
  2. Auto-detect non-TTY stdout and default to JSON (opt-out with --output table)
  3. Support TKN_OUTPUT_FORMAT=json environment variable for session-wide default
  4. Ensure all JSON output goes to stdout, all status/progress messages to stderr

Commands to update

  • pipeline list/describe/start/delete
  • pipelinerun list/describe/delete/cancel/logs
  • task list/describe/start/delete
  • taskrun list/describe/delete/cancel/logs
  • customrun list/describe/delete
  • bundle list/push
  • eventlistener list/describe
  • triggerbinding list/describe
  • triggertemplate list/describe
  • clustertriggerbinding list/describe

/kind feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions