Blog

How to Capture Fatal Local CLI Errors and Draft GitHub Tickets

Fatal CLI exits disappear when the terminal closes. Capture the command, classify the exit, and open a prefilled GitHub draft the developer still sends.

2026-10-23 · 3 min read · AethelLayer

What you see

A developer runs your CLI, it exits 1, and they close the tab. Support gets a sentence with no command, no exit code, and no stack. The bug exists only on that laptop.

Root cause

CLIs print to a terminal and exit. Nothing in the default Node process keeps stderr after the shell session ends. GitHub's issue form is a second context switch, so most people never open it. The failure is local and fatal; the ticket system is somewhere else.

What "auto draft" means

The probe writes the stack and the command to ~/.aethellayer/errors.json. If AETHEL_REPO is owner/name, or git remote get-url origin is a GitHub remote, it prints an issues/new URL with the title and body filled in. That is the draft. A person still hits send. The CLI does not hold a GitHub token and does not post the issue.

Wire the probe

bashnpx --yes @aethellayer/sdk init

Run the real command behind the probe. The double dash keeps your flags intact:

bashnpx --yes @aethellayer/sdk run -- your-cli auth login --env staging

Without an API key this stays on the machine and still prints the draft. With AETHEL_API_KEY set, the same failure is also posted to your workspace. npm install itself does not send that ping.

Name the repo

bashexport AETHEL_REPO=your-org/your-cli

If that variable is missing and there is no GitHub origin, the probe still saves the local log and tells you to set the repo. It will not invent github.com/acme/<folder>.

Capture the failure before they leave

Install the probe. It drafts the GitHub issue. You still send it.

npx --yes @aethellayer/sdk init