Define consistent exit codes for all tkn commands
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 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 --helpor a dedicated doc - Ensure errors on stderr include structured info when
--output jsonis set (e.g.{"error": "not found", "code": 2})
/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 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