Skip to content

Make pipelinerun/taskrun logs agent-friendly #2854

@vdemeester

Description

@vdemeester

Summary

tkn pipelinerun logs and tkn taskrun logs are likely the most-used commands by AI agents debugging CI/CD failures. The current output is optimized for human consumption with color codes and interleaved multi-container output that's hard to parse programmatically.

Proposal

  • --output json for structured log output with metadata (task name, step name, timestamp, message)
  • Ensure --follow works well in non-interactive/agent contexts
  • Clear separation of log lines per step/container in structured mode
  • Consider --timestamps in a parseable format (RFC3339)

Example

tkn pipelinerun logs my-run --output json
{"task": "build", "step": "build-step", "timestamp": "2026-05-12T10:00:00Z", "message": "Building image..."}
{"task": "build", "step": "build-step", "timestamp": "2026-05-12T10:00:01Z", "message": "Successfully built abc123"}

NDJSON (one line per log entry) is the natural format here since logs are a stream.

/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