[GH-ISSUE #5481] [Feature] Add shell completion for the REA CLI #3336

Closed
opened 2026-10-31 00:39:17 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @jayykernel on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5481

Before submitting

  • I searched for an existing shell-completion proposal.
  • This request does not include credentials, private samples, or sensitive target data.

Current limitation

REA exposes a large CLI with many inspection, comparison, capture, setup, and provider commands. Users currently need to discover and remember exact command and option names from help output and documentation. Shell completion would make common workflows easier to explore and reduce avoidable command-line typos.

I did not reproduce a runtime defect; this is a usability feature request.

Proposed change

Provide optional shell completions for the REA CLI, starting with Bash, Zsh, and Fish. PowerShell support could be included if it fits the existing cross-platform CLI setup.

Completion candidates should come from the canonical CLI command/option definitions where possible, rather than a hand-maintained list that drifts from the implementation. Document how to install and remove completions without silently editing shell startup files.

Acceptance criteria

  • Completion suggests supported top-level commands, subcommands, and flags.
  • Completion stays aligned with the current CLI definition and has a check or test that detects stale generated output.
  • Installing completions is opt-in and documented for each supported shell.
  • Completion does not launch analysis providers, open targets, or make network requests merely to offer static command and option names.
  • Unsupported or context-dependent values are not suggested as though they were guaranteed to be valid.
Originally created by @jayykernel on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5481 ### Before submitting - [x] I searched for an existing shell-completion proposal. - [x] This request does not include credentials, private samples, or sensitive target data. ### Current limitation REA exposes a large CLI with many inspection, comparison, capture, setup, and provider commands. Users currently need to discover and remember exact command and option names from help output and documentation. Shell completion would make common workflows easier to explore and reduce avoidable command-line typos. I did not reproduce a runtime defect; this is a usability feature request. ### Proposed change Provide optional shell completions for the REA CLI, starting with Bash, Zsh, and Fish. PowerShell support could be included if it fits the existing cross-platform CLI setup. Completion candidates should come from the canonical CLI command/option definitions where possible, rather than a hand-maintained list that drifts from the implementation. Document how to install and remove completions without silently editing shell startup files. ### Acceptance criteria - Completion suggests supported top-level commands, subcommands, and flags. - Completion stays aligned with the current CLI definition and has a check or test that detects stale generated output. - Installing completions is opt-in and documented for each supported shell. - Completion does not launch analysis providers, open targets, or make network requests merely to offer static command and option names. - Unsupported or context-dependent values are not suggested as though they were guaranteed to be valid.
Author
Owner

@ranmori commented on GitHub (Oct 26, 2026):

This looks already implemented on main and in the published rea-agents@6.8.0:

  • rea completions <bash|fish|nushell|zsh> prints a completion script, and rea completions --help lists the setup line for each shell (for example eval "$(rea completions bash)"). Nothing is written to shell startup files; installing is opt-in.
  • The scripts come from the CLI's own command definitions at run time (src/cli/completions.ts, src/cli/bashCompletionRegistration.ts), so there is no generated file that can drift. tests/boundary/cli/completions.test.ts covers it.
  • docs/cli.md has a "Shell completion" section, added in #6250 (c9204b96d), which is in the rea-agents-6.8.0 tag.

Checked on Windows 11 with a source build of main at b3818bbba: rea completions --help and rea completions bash both work. PowerShell is the one shell from the request that is not offered. I did not check whether completion ever starts a provider or opens a target.

Unless PowerShell support is wanted as a follow-up, this can probably be closed as completed.

<!-- gh-comment-id:6410939115 --> @ranmori commented on GitHub (Oct 26, 2026): This looks already implemented on `main` and in the published `rea-agents@6.8.0`: - `rea completions <bash|fish|nushell|zsh>` prints a completion script, and `rea completions --help` lists the setup line for each shell (for example `eval "$(rea completions bash)"`). Nothing is written to shell startup files; installing is opt-in. - The scripts come from the CLI's own command definitions at run time (`src/cli/completions.ts`, `src/cli/bashCompletionRegistration.ts`), so there is no generated file that can drift. `tests/boundary/cli/completions.test.ts` covers it. - `docs/cli.md` has a "Shell completion" section, added in #6250 (c9204b96d), which is in the `rea-agents-6.8.0` tag. Checked on Windows 11 with a source build of `main` at b3818bbba: `rea completions --help` and `rea completions bash` both work. PowerShell is the one shell from the request that is not offered. I did not check whether completion ever starts a provider or opens a target. Unless PowerShell support is wanted as a follow-up, this can probably be closed as completed.
Author
Owner

@morluto commented on GitHub (Oct 26, 2026):

Thanks for the completion request. Main provides opt-in Bash, Zsh, Fish and Nushell completion generated from the CLI command tree, with boundary coverage; #6250 documents Bash setup and removal, and rea completions --help gives the available shell setup commands. PowerShell support and fuller per-shell removal guidance remain possible follow-ups. I am closing the initial request as addressed; please reopen if a required command or option is missing or if those remaining details need tracking here. I did not rerun the shell workflows in this pass.

<!-- gh-comment-id:6428362097 --> @morluto commented on GitHub (Oct 26, 2026): Thanks for the completion request. Main provides opt-in Bash, Zsh, Fish and Nushell completion generated from the CLI command tree, with boundary coverage; #6250 documents Bash setup and removal, and `rea completions --help` gives the available shell setup commands. PowerShell support and fuller per-shell removal guidance remain possible follow-ups. I am closing the initial request as addressed; please reopen if a required command or option is missing or if those remaining details need tracking here. I did not rerun the shell workflows in this pass.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#3336
No description provided.