Skip to content

feat(cli): deno remove --global as alias for deno uninstall --global#35327

Merged
bartlomieju merged 1 commit into
mainfrom
feat/remove-global-alias
Jun 19, 2026
Merged

feat(cli): deno remove --global as alias for deno uninstall --global#35327
bartlomieju merged 1 commit into
mainfrom
feat/remove-global-alias

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

deno uninstall --global <name> removes a globally installed executable
script, but deno remove had no global counterpart, so users who reached
for deno remove --global <name> (the natural symmetric spelling) got an
unknown-argument error and had to remember the separate uninstall verb.
This adds --global (and -g) to deno remove as an alias for
deno uninstall --global, removing the globally installed executable.

The flag is handled in remove_parse and routed to the same Uninstall
subcommand the uninstaller already uses, so both commands share one code
path rather than duplicating logic. --root is supported and requires
--global, matching uninstall, and --lockfile-only / --package-json
conflict with --global since they are meaningless for a global removal.
A global removal targets a single executable, so passing multiple names
together with --global is rejected, mirroring how uninstall --global
rejects extra packages.

…l --global`

`deno remove --global <name>` now removes a globally installed executable
script, behaving exactly like `deno uninstall --global <name>`. The flag is
parsed in `remove_parse` and routed to the same `Uninstall` subcommand the
uninstaller uses, so the two share one code path. `--root` is supported (and
requires `--global`), and a global removal targets a single executable, so
passing multiple names with `--global` is rejected, matching `uninstall`.

Adds flag-parse unit tests and a hermetic spec test that installs a local
script globally and removes it via `deno remove --global`.
@bartlomieju

Copy link
Copy Markdown
Member Author

Prompted by discussion here: expressjs/expressjs.com#2395 (comment)

@bartlomieju bartlomieju merged commit 2c40806 into main Jun 19, 2026
136 checks passed
@bartlomieju bartlomieju deleted the feat/remove-global-alias branch June 19, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant