tektoncd / tektoncd/cli

Add consistent --output json support to all tkn commands

Open
#2,850 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature
Dominant language
Go
Stars
461
Forks
277
Avg merge
16h 48m
Merged PRs (30d)
95

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inventorying the listed pipeline, pipelinerun, task, taskrun, customrun, bundle, eventlistener, triggerbinding, triggertemplate, and clustertriggerbinding commands, comparing existing PrintObjects and PrintObjectV1 support with commands such as logs, delete, and cancel. Done means every listed output-producing command supports JSON and YAML, non-TTY output defaults to JSON with a table opt-out, TKN_OUTPUT_FORMAT is honored, and JSON uses stdout while status messages use stderr.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.