fix: suppress banner and doctor checks for completion command

This commit is contained in:
Shakker 2026-01-31 04:44:46 +00:00 committed by Shakker
parent beafaef92f
commit 48aaf6ce4e

View file

@ -31,6 +31,7 @@ export function registerPreActionHooks(program: Command, programVersion: string)
const hideBanner = const hideBanner =
isTruthyEnvValue(process.env.OPENCLAW_HIDE_BANNER) || isTruthyEnvValue(process.env.OPENCLAW_HIDE_BANNER) ||
commandPath[0] === "update" || commandPath[0] === "update" ||
commandPath[0] === "completion" ||
(commandPath[0] === "plugins" && commandPath[1] === "update"); (commandPath[0] === "plugins" && commandPath[1] === "update");
if (!hideBanner) { if (!hideBanner) {
emitCliBanner(programVersion); emitCliBanner(programVersion);
@ -40,7 +41,7 @@ export function registerPreActionHooks(program: Command, programVersion: string)
if (!verbose) { if (!verbose) {
process.env.NODE_NO_WARNINGS ??= "1"; process.env.NODE_NO_WARNINGS ??= "1";
} }
if (commandPath[0] === "doctor") return; if (commandPath[0] === "doctor" || commandPath[0] === "completion") return;
await ensureConfigReady({ runtime: defaultRuntime, commandPath }); await ensureConfigReady({ runtime: defaultRuntime, commandPath });
// Load plugins for commands that need channel access // Load plugins for commands that need channel access
if (PLUGIN_REQUIRED_COMMANDS.has(commandPath[0])) { if (PLUGIN_REQUIRED_COMMANDS.has(commandPath[0])) {