Skip to content

Add schema introspection command (tkn schema) #2852

@vdemeester

Description

@vdemeester

Summary

AI agents need to discover API schemas at runtime without consuming documentation tokens. A tkn schema command would make the CLI self-documenting.

Proposal

# Show PipelineRun CRD schema
tkn schema pipelinerun

# Show what tkn pipeline start accepts
tkn schema pipeline.start

# List all available resources
tkn schema --list

Output should be machine-readable JSON containing field names, types, required/optional status, and descriptions.

Implementation Ideas

  • Use Tekton API server discovery (/openapi/v2 or /openapi/v3)
  • Parse CRD schemas from the cluster
  • Optionally bundle a fallback static schema for offline use

Value

  • Agents can self-serve API structure without pre-stuffed documentation
  • Reduces hallucinated field names and values
  • Schema is always in sync with the actual cluster version

/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