elastic / elastic/cli

feat: add help topics for formatting, environment, and exit codes

Open
#630 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
41
Forks
24
Avg merge
1d 3h
Merged PRs (30d)
56

Description

We have `--json`, `--output-fields`, `--output-template`, config env vars, and exit 0/1, but no single discoverable place for them. Root `--help` also hides `--output-fields` / `--output-template` unless they are already on argv (`src/cli.ts`).

Add hidden commands (or an `elastic help ` router):

- `formatting`: `--json`, `--output-fields`, `--output-template`, table vs pretty JSON, `--help --json`
- `environment`: `ELASTIC_CLI_CONFIG_FILE`, `ELASTIC_CLI_TELEMETRY`, `ELASTIC_NO_BANNER`, `NO_COLOR`, config search paths, keychain backends
- `exit-codes`: document current 0/1 and reserve codes we intend to stabilize

List topics at the bottom of root `--help` as LEARN MORE. Always show global output flags on root `--help` even when they are absent from argv.

Acceptance: `elastic help formatting` (or equivalent) prints the topic. Root `--help` names the topics and the global output flags.

Contributor guide

Open the contributing guide

Research direction

Start in src/cli.ts and trace the existing root help handling and command routing. Check how argv-dependent global output flags are currently shown, then implement the help topics and root LEARN MORE entries; done means the topic command prints formatting, environment, and exit-code guidance and root --help names both the topics and output flags.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.