Skip to content

Define consistent exit codes for all tkn commands #2855

@vdemeester

Description

@vdemeester

Summary

AI agents rely on exit codes to determine success/failure without parsing output. Currently tkn exit codes are inconsistent and undocumented.

Proposal

Define and document a consistent exit code scheme:

Code Meaning
0 Success
1 General error / command failure
2 Resource not found
3 Invalid input / validation error
4 Timeout
5 Unauthorized / forbidden

Acceptance Criteria

  • Audit all commands for current exit code behavior
  • Implement consistent exit codes across all commands
  • Document exit codes in tkn --help or a dedicated doc
  • Ensure errors on stderr include structured info when --output json is set (e.g. {"error": "not found", "code": 2})

/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