fix: auth failures should point at status and config edit
Author: margaretjguCreated Sep 14, 2026Updated Sep 22, 2026
Labelsenhancement
TLS errors already append a hint (src/es/errors.ts). 401/403 from ES, Kibana, or Cloud usually dump the transport body.
On 401/403 (and expired API key if we can detect it), append one hint:
elastic status --jsonto see which service failedelastic config context edit(or the Cloud reset-credentials command when the context is a Serverless project)
Keep the original server message. Hint goes on stderr after it. --json puts the hint in error.hint so agents can parse it.
Acceptance: mock 401 on elastic stack es ping --json includes error.hint naming elastic status.
Source: elastic/cli