Add machine-readable error codes to JSON commands

Open
#3,697 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

Start by tracing how JSON-mode commands handle errors and where approval, hook, Git, and input or unsupported-operation failures originate. Decide how those paths can expose stable machine-readable codes while preserving human diagnostics on stderr; done means callers can classify all four requested failure categories without matching human-readable text.

Written by the indexing model from the issue text.

Description

Motivation

Callers using --format=json can parse successful results, but failures such as approval-required, hook failure, and Git failure still require compatibility matching against human-readable stderr.

Request

For JSON-mode commands, return a stable structured error envelope or another documented machine-readable error channel with codes for at least:

  • approval required;
  • hook failure;
  • Git failure;
  • invalid input or unsupported operation.

Human diagnostics can remain on stderr, but callers should not need regexes to classify failures.

Dominant language
Rust
Stars
8.8k
Forks
315
Avg merge
1d 6h
Merged PRs (30d)
204

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from max-sixty/worktrunk

All issues in max-sixty/worktrunk

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.