style: tidy cli formatting

This commit is contained in:
Peter Steinberger
2026-01-08 08:24:57 +01:00
parent c7cade5232
commit 5b397c0f15
7 changed files with 25 additions and 17 deletions

View File

@@ -1127,7 +1127,9 @@ export function registerNodesCli(program: Command) {
defaultRuntime.log("canvas a2ui reset ok");
}
} catch (err) {
defaultRuntime.error(`nodes canvas a2ui reset failed: ${String(err)}`);
defaultRuntime.error(
`nodes canvas a2ui reset failed: ${String(err)}`,
);
defaultRuntime.exit(1);
}
}),

View File

@@ -23,7 +23,6 @@ import {
} from "../config/config.js";
import { danger, setVerbose } from "../globals.js";
import { autoMigrateLegacyState } from "../infra/state-migrations.js";
import { runProviderLogin, runProviderLogout } from "./provider-auth.js";
import { defaultRuntime } from "../runtime.js";
import { isRich, theme } from "../terminal/theme.js";
import { VERSION } from "../version.js";
@@ -42,6 +41,7 @@ import { registerModelsCli } from "./models-cli.js";
import { registerNodesCli } from "./nodes-cli.js";
import { registerPairingCli } from "./pairing-cli.js";
import { forceFreePort } from "./ports.js";
import { runProviderLogin, runProviderLogout } from "./provider-auth.js";
import { registerProvidersCli } from "./providers-cli.js";
import { registerSkillsCli } from "./skills-cli.js";
import { registerTuiCli } from "./tui-cli.js";
@@ -576,7 +576,12 @@ Examples:
.option("--workspace <dir>", "Workspace directory for the new agent")
.option("--model <id>", "Model id for this agent")
.option("--agent-dir <dir>", "Agent state directory for this agent")
.option("--bind <provider[:accountId]>", "Route provider binding (repeatable)", collectOption, [])
.option(
"--bind <provider[:accountId]>",
"Route provider binding (repeatable)",
collectOption,
[],
)
.option("--non-interactive", "Disable prompts; requires --workspace", false)
.option("--json", "Output JSON summary", false)
.action(async (name, opts, command) => {
@@ -594,7 +599,9 @@ Examples:
workspace: opts.workspace as string | undefined,
model: opts.model as string | undefined,
agentDir: opts.agentDir as string | undefined,
bind: Array.isArray(opts.bind) ? (opts.bind as string[]) : undefined,
bind: Array.isArray(opts.bind)
? (opts.bind as string[])
: undefined,
nonInteractive: Boolean(opts.nonInteractive),
json: Boolean(opts.json),
},

View File

@@ -1,7 +1,7 @@
import { loadConfig } from "../config/config.js";
import { setVerbose } from "../globals.js";
import { defaultRuntime, type RuntimeEnv } from "../runtime.js";
import { loginWeb, logoutWeb } from "../provider-web.js";
import { defaultRuntime, type RuntimeEnv } from "../runtime.js";
import { resolveWhatsAppAccount } from "../web/accounts.js";
type ProviderAuthOptions = {
@@ -11,7 +11,9 @@ type ProviderAuthOptions = {
};
function normalizeProvider(raw?: string): "whatsapp" | "web" {
const value = String(raw ?? "whatsapp").trim().toLowerCase();
const value = String(raw ?? "whatsapp")
.trim()
.toLowerCase();
if (value === "whatsapp" || value === "web") return value;
throw new Error(`Unsupported provider: ${value}`);
}
@@ -36,7 +38,7 @@ export async function runProviderLogout(
opts: ProviderAuthOptions,
runtime: RuntimeEnv = defaultRuntime,
) {
const provider = normalizeProvider(opts.provider);
const _provider = normalizeProvider(opts.provider);
// Auth-only flow: resolve account + clear session state only.
const cfg = loadConfig();
const account = resolveWhatsAppAccount({

View File

@@ -6,11 +6,11 @@ import {
providersRemoveCommand,
providersStatusCommand,
} from "../commands/providers.js";
import { listChatProviders } from "../providers/registry.js";
import { danger } from "../globals.js";
import { listChatProviders } from "../providers/registry.js";
import { defaultRuntime } from "../runtime.js";
import { runProviderLogin, runProviderLogout } from "./provider-auth.js";
import { hasExplicitOptions } from "./command-options.js";
import { runProviderLogin, runProviderLogout } from "./provider-auth.js";
const optionNamesAdd = [
"provider",