tektoncd / tektoncd/cli

Define consistent exit codes for all tkn commands

Open
#2,855 0 comments 0 reactions 0 assignees View on GitHub

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 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by auditing all tkn command entry points and their current exit-code behavior, then review how tkn --help and --output json errors are handled. Done means every command follows the proposed code scheme, the scheme is documented, and JSON errors on stderr include structured error information.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.