fix(cli): keep update completion refresh lightweight

This commit is contained in:
Peter Steinberger
2026-04-27 08:23:44 +01:00
parent 1ee893bc5f
commit f427ddc220
7 changed files with 55 additions and 9 deletions

View File

@@ -10,6 +10,7 @@ import {
} from "./completion-fish.js";
import {
COMPLETION_SHELLS,
COMPLETION_SKIP_PLUGIN_COMMANDS_ENV,
installCompletion,
isCompletionShell,
resolveCompletionCachePath,
@@ -106,10 +107,12 @@ export function registerCompletionCli(program: Command) {
// Eagerly register all subcommands except completion itself to build the full tree.
await registerSubcommandsForCompletion(program);
const { registerPluginCliCommandsFromValidatedConfig } = await import("../plugins/cli.js");
await registerPluginCliCommandsFromValidatedConfig(program, undefined, undefined, {
mode: "eager",
});
if (process.env[COMPLETION_SKIP_PLUGIN_COMMANDS_ENV] !== "1") {
const { registerPluginCliCommandsFromValidatedConfig } = await import("../plugins/cli.js");
await registerPluginCliCommandsFromValidatedConfig(program, undefined, undefined, {
mode: "eager",
});
}
if (options.writeState) {
const writeShells = options.shell ? [shell] : [...COMPLETION_SHELLS];