INNER CODE UNIT · TypeScript

hasConfiguredWallet

BlockRunAI/ClawRouter · src/index.ts:117

function hasConfiguredWallet(): boolean {
  return Boolean(
    process["env"].BLOCKRUN_WALLET_KEY || existsSync(CORE_WALLET_FILE) || existsSync(WALLET_FILE),
  );
}

/**
 * Detect if we're running in shell completion mode.
 * When `openclaw completion --shell zsh` runs, it loads plugins but only needs
 * the completion script output - any stdout logging pollutes the script and
 * causes zsh to interpret colored text like `[plugins]` as glob patterns.
 */
function isCompletionMode(): boolean {
  const args = process.argv;
  // Check for: openclaw completion --shell <shell>
  // argv[0] = node/bun, argv[1] = openclaw, argv[2] = completion
  return args.some((arg, i) => arg === "completion" && i >= 1 && i <= 3);
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…