fix: missing config errors should name the next command
- Dominant language
- TypeScript
- Stars
- 41
- Forks
- 24
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 56
Description
A missing or empty config writes the raw loader error and exits (`src/cli.ts` preAction). A new user or agent that runs `elastic stack es ping` with no `~/.elasticrc.yml` should be told exactly what to run.
On missing file, empty `current_context`, or unresolved credentials:
- Local/TTY: point at `elastic config context add` and `elastic status`
- Non-TTY / CI: name `ELASTIC_CLI_CONFIG_FILE` and the required YAML keys
- 401/403 from a configured context: point at `elastic status --json` and `elastic config context edit`
Do not build the #625 quickstart wizard here. This is the error path only.
Acceptance: wipe config, run `elastic stack es ping`, stderr names `elastic config context add`. Same message under `--json` as `error.code` plus `error.message`.
Contributor guide
Assessment
This issue has not been assessed yet.