Add schema introspection command (tkn schema)
Open
Nobody has claimed this yet.
kind/feature
- Dominant language
- Go
- Stars
- 461
- Forks
- 277
- Avg merge
- 16h 48m
- Merged PRs (30d)
- 95
Description
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/v2or/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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the proposed tkn schema entry points and the Tekton API server discovery options at /openapi/v2 and /openapi/v3. Compare how PipelineRun CRD schemas and pipeline.start inputs would be identified, then define machine-readable JSON output and the behavior of --list and offline fallback before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, openapi
- Domain
- api, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100