From 2c229bc18084912c43c93c8ef6394cb3576f5a16 Mon Sep 17 00:00:00 2001 From: lihan3238 Date: Tue, 5 May 2026 23:40:03 +0800 Subject: [PATCH 1/2] fix(cli): replace all hyphens in shell completion command names The shell completion generators for bash and zsh used `command.replace("-", "__")` which only replaces the first hyphen in command names. For commands with multiple hyphens like `type-check-v2`, this produced `type__check-v2` instead of the correct `type__check__v2`. Partially addresses #6114 --- packages/cli/src/internal/commandDescriptor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/internal/commandDescriptor.ts b/packages/cli/src/internal/commandDescriptor.ts index 5b8437800aa..f696d8b132e 100644 --- a/packages/cli/src/internal/commandDescriptor.ts +++ b/packages/cli/src/internal/commandDescriptor.ts @@ -1081,7 +1081,7 @@ const getBashCompletionsInternal = ( : pipe( info.parentCommands, Arr.append(info.command.name), - Arr.map((command) => command.replace("-", "__")) + Arr.map((command) => command.replaceAll("-", "__")) ) const caseName = Arr.join(preformatted, ",") const funcName = Arr.join(preformatted, "__") @@ -1238,7 +1238,7 @@ const getZshCompletionsInternal = ( : pipe( info.parentCommands, Arr.append(info.command.name), - Arr.map((command) => command.replace("-", "__")) + Arr.map((command) => command.replaceAll("-", "__")) ) const underscoreName = Arr.join(preformatted, "__") const spaceName = Arr.join(preformatted, " ") From 345ce6dc07d0bc01436fb22e6eb62a54ba195cda Mon Sep 17 00:00:00 2001 From: lihan3238 Date: Fri, 8 May 2026 12:12:52 +0800 Subject: [PATCH 2/2] add changeset --- .changeset/fix-cli-completions-hyphen.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fix-cli-completions-hyphen.md diff --git a/.changeset/fix-cli-completions-hyphen.md b/.changeset/fix-cli-completions-hyphen.md new file mode 100644 index 00000000000..3b681f5c963 --- /dev/null +++ b/.changeset/fix-cli-completions-hyphen.md @@ -0,0 +1,5 @@ +--- +"@effect/cli": patch +--- + +fix(cli): replace all hyphens in shell completion command names