





















@@ -350,7 +350,9 @@ export async function modelsAuthSetupTokenCommand(
350350runtime: RuntimeEnv,
351351) {
352352if (!process.stdin.isTTY) {
353-throw new Error("setup-token requires an interactive TTY.");
353+throw new Error(
354+`setup-token requires an interactive TTY. In automation, use ${formatCliCommand("openclaw models auth paste-token --provider <provider>")} instead.`,
355+);
354356}
355357356358const { config, agentDir, workspaceDir, providers } = await resolveModelsAuthContext({
@@ -367,7 +369,9 @@ export async function modelsAuthSetupTokenCommand(
367369const provider =
368370resolveRequestedProviderOrThrow(tokenProviders, opts.provider) ?? tokenProviders[0] ?? null;
369371if (!provider) {
370-throw new Error("No token-capable provider is available.");
372+throw new Error(
373+`No token-capable provider is available. Run ${formatCliCommand("openclaw plugins list")} to verify provider plugins are installed.`,
374+);
371375}
372376373377if (!opts.yes) {
@@ -512,7 +516,9 @@ export async function modelsAuthAddCommand(opts: { agent?: string }, runtime: Ru
512516const prompter = createClackPrompter();
513517const method = tokenMethods.find((candidate) => candidate.id === methodId);
514518if (!method) {
515-throw new Error(`Unknown token auth method "${methodId}".`);
519+throw new Error(
520+`Unknown token auth method "${methodId}". Run ${formatCliCommand("openclaw models auth login --provider " + providerPlugin.id)} to choose interactively.`,
521+);
516522}
517523await runProviderAuthMethod({
518524 config,
@@ -618,7 +624,9 @@ function maybeLogOpenAICodexNativeSearchTip(runtime: RuntimeEnv, providerId: str
618624}
619625export async function modelsAuthLoginCommand(opts: LoginOptions, runtime: RuntimeEnv) {
620626if (!process.stdin.isTTY) {
621-throw new Error("models auth login requires an interactive TTY.");
627+throw new Error(
628+`models auth login requires an interactive TTY. In automation, use ${formatCliCommand("openclaw models auth paste-token --provider <provider>")} when token auth is available.`,
629+);
622630}
623631624632const { config, agentDir, workspaceDir, providers } = await resolveModelsAuthContext({
@@ -648,7 +656,9 @@ export async function modelsAuthLoginCommand(opts: LoginOptions, runtime: Runtim
648656.then((id) => resolveProviderMatch(authProviders, id)));
649657650658if (!selectedProvider) {
651-throw new Error("Unknown provider. Use --provider <id> to pick a provider plugin.");
659+throw new Error(
660+`Unknown provider. Run ${formatCliCommand("openclaw models status")} or ${formatCliCommand("openclaw plugins list")} to see available provider plugins.`,
661+);
652662}
653663const chosenMethod = await pickProviderAuthMethod({
654664provider: selectedProvider,
@@ -657,7 +667,9 @@ export async function modelsAuthLoginCommand(opts: LoginOptions, runtime: Runtim
657667});
658668659669if (!chosenMethod) {
660-throw new Error("Unknown auth method. Use --method <id> to select one.");
670+throw new Error(
671+`Unknown auth method. Run ${formatCliCommand("openclaw models auth login --provider " + selectedProvider.id)} without --method to choose interactively.`,
672+);
661673}
662674663675await runProviderAuthMethod({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。