Skip to content

Define consistent exit codes for all tkn commands #2855

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

Activity

  1. added a commit that references this issue on Nov 2, 2026
    657710d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions