elastic / elastic/cli

feat: add Examples sections on high-traffic commands

Open
#633 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

Generated `--help` is schema descriptions only. That is correct for 200+ generated endpoints and wrong for the commands people actually run first.

Hand-author `Examples` (commander `addHelpText`) on a short list, not the full tree:

- `elastic config context add` / `list` / `current-context set`
- `elastic status`
- `elastic stack es search`, `indices create`, `indices delete`, `cat indices`
- `elastic cloud serverless projects create` (and the `--save-as` path)
- `elastic docs search`

Keep examples copy-pasteable. One happy path, one `--json`, one `--dry-run` where it mutates.

Acceptance: each listed command's `--help` has an Examples block. Tests assert the strings are present so codegen cannot wipe them.

Contributor guide

Open the contributing guide

Research direction

Start at the listed command definitions and the commander addHelpText usage, then inspect how generated --help output is tested. Add Examples blocks for each requested command, including the specified happy path, --json, and applicable --dry-run or --save-as cases. Done when tests confirm every listed command's --help contains its examples.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.