GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add shell completions by alexander-akait · Pull Request #4840 · webpack/webpack-cli

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

Builds on @AmirSa12's #4829 (their commit is kept as-is, first in this branch) and fixes the two things that stood between it and covering every command. Closes #1402.

  • Aliases resolved. @bomb.sh/tab registers each command under command.name() and has no alias concept, so completing after one returned only the global options: webpack b <TAB> offered 4 candidates against build's 21, webpack s <TAB> 4 against serve's 94. The alias being completed is now registered against the command it stands for. Only the requested alias is registered, so webpack <TAB> still lists the eight commands instead of all thirteen names — flip that if you would rather aliases were discoverable.
  • The parser is optional. @bomb.sh/tab moves from dependencies to an optional peer, alongside webpack-dev-server, webpack-bundle-analyzer, js-yaml, json5 and toml. It is imported only to serve a completion request. A shell runs complete -- <words> on every keypress, so a missing package is silent there (exit 0, nothing on either stream), while complete <shell> reports what to install in the usual format.

Also updates the dev-server 6 help snapshots, added after #4829 branched — without them its CI fails on every dev-server 6 job.

Not covered, and inherent rather than an oversight: third-party commands, which the CLI resolves by import(commandName) as a package, so there is no set to enumerate before one is typed.

What kind of change does this PR introduce?

feat

Did you add tests for your changes?

Yes — test/complete/complete.test.js gains three cases on top of #4829's six: an alias offers byte-identical candidates to its command, values complete through an alias (b --mode=), and aliases stay out of the command suggestions. Measured before and after across all commands:

typed before after
build / watch 21 21
b, bundle, w 4 21
serve 94 94
s, server 4 94

The missing-package paths were checked by hand (both streams empty for a resolution request; exit 2 with the install message for complete zsh) since simulating an absent package inside the suite is not worth the machinery.

Does this PR introduce a breaking change?

No — a new command, and the parser it needs is optional.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Installing completions per shell: webpack complete zsh (and bash/fish/powershell) prints the script to source, and @bomb.sh/tab has to be installed to use it.

Use of AI

Claude Code was used to review #4829 by running its CLI, which is how the alias gap was measured, to read @bomb.sh/tab's adapter and find that it keys commands by name, and to write the fix and its tests. All changes were reviewed before committing.


Generated by Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AmirSa12 reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@AmirSa12 @claude
feat: add tab completions
313f96b
@changeset-bot

changeset-bot Bot commented Aug 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 67bd238

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
webpack-cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@socket-security

socket-security Bot commented Aug 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​bomb.sh/​tab@​0.0.2210010010099100

View full report

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Aug 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR is packaged and the instant preview is available (f145401).

Install it locally:

  • npm
npm i -D webpack-cli@https://pkg.pr.new/webpack-cli@f145401
  • yarn
yarn add -D webpack-cli@https://pkg.pr.new/webpack-cli@f145401
  • pnpm
pnpm add -D webpack-cli@https://pkg.pr.new/webpack-cli@f145401
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Aug 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.93909% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.81%. Comparing base (7d40e4e) to head (67bd238).

Files with missing lines Patch % Lines
packages/webpack-cli/src/webpack-cli.ts 95.93% 8 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4840      +/-   ##
==========================================
+ Coverage   94.78%   94.81%   +0.03%     
==========================================
  Files          14       14              
  Lines        5406     5598     +192     
  Branches      799      837      +38     
==========================================
+ Hits         5124     5308     +184     
- Misses        281      289       +8     
  Partials        1        1              
Files with missing lines Coverage Δ
packages/webpack-cli/src/webpack-cli.ts 96.70% <95.93%> (-0.05%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d40e4e...67bd238. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait @AmirSa12
fix(complete): resolve command aliases and make the parser optional
df97606
Completing after an alias returned only the global options, because
`@bomb.sh/tab` registers each command under `command.name()` and has no
alias concept: `webpack b <TAB>` offered 4 candidates where `webpack build
<TAB>` offers 25, and `webpack s <TAB>` 4 against `serve`'s 98. The alias
being completed is now registered against the command it stands for, so
every alias resolves. Only the requested one is registered, which keeps
`webpack <TAB>` listing the eight commands rather than all thirteen names.

Global options are registered on the root command, so nothing offered them
after a command, though they are accepted there: `webpack build --col` did
not complete `--color`, and `configtest`, `help` and `complete` offered
nothing at all, having no options of their own. Every command now carries
them.

`@bomb.sh/tab` also moves to an optional peer dependency, next to the other
packages the CLI loads on demand. It is imported only to serve a completion
request, so installing it is the user's choice: the shell runs
`complete -- <words>` on every keypress and now gets silence when the
package is absent, while `complete <shell>` says what to install.

Also updates the dev-server 6 help snapshots, which were added after this
work branched.

Co-authored-by: AmirSa12 <[email protected]>
@alexander-akait
alexander-akait force-pushed the feat/tab-completions branch from 095d282 to df97606 Compare August 28, 2026 11:30
alexander-akait and others added 4 commits August 28, 2026 11:33
@alexander-akait @AmirSa12
fix(complete): keep a partial command expanding to its full name
6b039e2
Registering the requested alias made it a suggestion of its own, so
`webpack b<TAB>` offered `build` and `b` and the shell, having two
candidates, left the word at their common prefix instead of writing
`build` out. The last word is the one being typed, so only the words
before it name the command an alias has to resolve.

Co-authored-by: AmirSa12 <[email protected]>
@alexander-akait @AmirSa12
test(complete): cover the option-value handlers
66e5459
Patch coverage reported 30 uncovered lines, most of them handler bodies
that only run while the option they belong to is being completed. Covers
`build --progress`, `version --output`, the root `--help`, and the shell
argument of `complete` itself.

Co-authored-by: AmirSa12 <[email protected]>
@alexander-akait
test(complete): cover the missing-parser paths
da04338
`@bomb.sh/tab` is optional, so the two paths that run without it carry the
behaviour a user without it sees, and both were checked by hand only. A
resolve hook now hides the package the way an install that never had it
does, pinning that a completion request prints nothing on either stream and
that asking for a script reports what to install.
@alexander-akait @AmirSa12
docs: describe shell completion
67bd238
Covers what completes, that `@bomb.sh/tab` has to be installed for it, and
the line to add per shell. Also lists `complete` among the commands in both
readmes, the second of which quotes `--help` and so has to match it.

Co-authored-by: AmirSa12 <[email protected]>
@alexander-akait
alexander-akait merged commit f145401 into main Aug 28, 2026
41 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait
alexander-akait deleted the feat/tab-completions branch August 28, 2026 13:54
@github-actions github-actions Bot mentioned this pull request Aug 28, 2026
chore(release): new release #4841
Merged
markharding pushed a commit to futo-org/Harbor that referenced this pull request Nov 3, 2026
harbor-bot @markharding
Update dependency webpack-cli to v7.3.1 (#2163)
eb5e82d
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [webpack-cli](https://github.com/webpack/webpack-cli/tree/main/packages/webpack-cli) ([source](https://github.com/webpack/webpack-cli)) | [`7.2.3` → `7.3.1`](https://renovatebot.com/diffs/npm/webpack-cli/7.2.3/7.3.1) | ![age](https://developer.mend.io/api/mc/badges/age/npm/webpack-cli/7.3.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/webpack-cli/7.2.3/7.3.1?slim=true) |

---

### Release Notes

<details>
<summary>webpack/webpack-cli (webpack-cli)</summary>

### [`v7.3.1`](https://github.com/webpack/webpack-cli/blob/HEAD/CHANGELOG.md#731)

[Compare Source](https://github.com/webpack/webpack-cli/compare/[email protected]@7.3.1)

##### Patch Changes

- fix: detect missing package managers and failed installations, without a lock file the CLI chose npm even when it wasn't installed instead of yarn or pnpm, and it continued after a package failed to install (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;4889](webpack/webpack-cli#4889))

- chore: replace the `import-local` and `cross-spawn` dependencies with Node.js built-ins (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;4889](webpack/webpack-cli#4889))

- chore: load configuration files with `import()` instead of `eval` (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;4893](webpack/webpack-cli#4893))

### [`v7.3.0`](https://github.com/webpack/webpack-cli/blob/HEAD/CHANGELOG.md#730)

[Compare Source](https://github.com/webpack/webpack-cli/compare/[email protected]@7.3.0)

##### Minor Changes

- feat: run `webpack-dev-server@6` as a compiler plugin. The CLI drives watch compilation, prints build stats and closes the compiler on shutdown. Older dev servers continue to manage their own compilation. (by [@&#8203;bjohansebas](https://github.com/bjohansebas) in [#&#8203;4847](webpack/webpack-cli#4847))

  In multi-compiler mode, every dev server serves all compilers by default. Use the new `--dev-server-per-compiler` option of `webpack serve` to serve each compiler only by the dev server from its own configuration.

- feat: add shell completions for zsh, bash, fish and powershell through the `complete` command (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;4840](webpack/webpack-cli#4840))

##### Patch Changes

- fix: keep multi-compiler options such as `parallelism` and `plugins` set on a configuration array when `--config-name` or `extends` rebuild it (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;4871](webpack/webpack-cli#4871))

- perf: share the compile cache with child processes and worker threads, such as minimizer workers, so they start warm too (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;4872](webpack/webpack-cli#4872))

- fix: assign distinct ports to dev servers of configurations that share the same `devServer` object. (by [@&#8203;alexander-akait](https://github.com/alexander-akait) in [#&#8203;4886](webpack/webpack-cli#4886))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 9am on tuesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xODguMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE4OC4yIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://code.futo.org/harbor/harbor/pulls/2163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Feature:- AUTO TAB completion of flags

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@alexander-akait @AmirSa12
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.