Skip to content

Support structured JSON input for start commands #2851

@vdemeester

Description

@vdemeester

Summary

AI agents generate JSON more reliably than combinations of bespoke flags. tkn pipeline start and tkn task start should accept a full PipelineRun/TaskRun spec as JSON input.

Current State

Parameters are passed as --param key=value flags, workspaces as --workspace name=pvc,claimName=my-pvc, etc. This requires agents to understand custom flag syntax that doesn't map directly to the Kubernetes API.

Proposal

# From flag
tkn pipeline start my-pipeline --json '{
  "params": [{"name": "repo-url", "value": "https://github.com/..."}],
  "workspaces": [{"name": "shared", "persistentVolumeClaim": {"claimName": "my-pvc"}}]
}'

# From stdin
cat run-spec.json | tkn pipeline start my-pipeline --json -

# From file
tkn pipeline start my-pipeline --json @run-spec.json

The JSON should map directly to the PipelineRun/TaskRun spec, with zero translation layer.

Acceptance Criteria

  • tkn pipeline start accepts --json with inline JSON, stdin (-), or file (@path)
  • tkn task start accepts --json similarly
  • JSON maps directly to PipelineRun/TaskRun .spec fields
  • Existing flags continue to work unchanged
  • Clear error messages when JSON is malformed

/kind feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions