feat: add Examples sections on high-traffic commands

Open
#633 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

enhancement

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.

Dominant language
TypeScript
Stars
43
Forks
24
Avg merge
1d 6h
Merged PRs (30d)
59

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elastic/cli

All issues in elastic/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.