Skip to content

Make tkn CLI agent-friendly for AI/LLM consumption #2849

@vdemeester

Description

@vdemeester

Summary

AI agents are increasingly using CLIs as their primary interface to external systems. The tkn CLI should be optimized for both human and agent consumption, following principles from You Need to Rewrite Your CLI for AI Agents.

Motivation

AI coding agents (Copilot, Claude Code, Cursor, etc.) use CLIs directly. They need:

  • Deterministic, machine-readable output — not tables designed for human eyes
  • Self-describing conventions — agents need to know how to use the CLI efficiently
  • Structured input — agents generate JSON more reliably than bespoke flag combinations
  • Reliable exit codes — agents depend on exit codes, not output parsing

Currently, tkn has inconsistent --output support, no non-TTY auto-detection, undocumented exit codes, and no structured JSON input path.

Sub-issues

Ordered by priority / effort-to-value ratio:

  1. Ship a CONTEXT.md for AI agent consumption #2856Ship a CONTEXT.md for AI agents (zero code, highest ROI)
  2. Add consistent --output json support to all tkn commands #2850Consistent --output json on all commands + non-TTY auto-detection
  3. Define consistent exit codes for all tkn commands #2855Consistent, documented exit codes
  4. Support structured JSON input for start commands #2851Structured JSON input for start commands
  5. Make pipelinerun/taskrun logs agent-friendly #2854Agent-friendly logs output (structured NDJSON logs)

Non-goals (for now)

References

/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