@gguf/claw
Version:
Multi-channel AI gateway with extensible messaging integrations
203 lines (201 loc) • 10.7 kB
JavaScript
import "./paths-B4BZAPZh.js";
import { B as theme } from "./utils-CP9YLh6M.js";
import "./thinking-EAliFiVK.js";
import "./reply-BylFHBd4.js";
import "./registry-B-j4DRfe.js";
import { f as defaultRuntime } from "./subsystem-BCQGGxdd.js";
import "./exec-DYqRzFbo.js";
import "./agent-scope-BnZW9Gh2.js";
import "./model-selection-CqaTAlhy.js";
import "./github-copilot-token-D2zp6kMZ.js";
import "./boolean-BsqeuxE6.js";
import "./env-VriqyjXT.js";
import "./message-channel-Bena1Tzd.js";
import "./send-CsyONLnQ.js";
import "./config-PQiujvsf.js";
import "./manifest-registry-4k4vkhPS.js";
import "./runner-U04aiHHC.js";
import "./image-DxEpBZim.js";
import "./models-config-B459BnCS.js";
import "./pi-model-discovery-4uUnLc3n.js";
import "./pi-embedded-helpers-BdscQhyS.js";
import "./sandbox-UAzvS0V6.js";
import "./image-ops-CI1VknD1.js";
import "./common-a25M2Kvi.js";
import "./chrome-Dd5zBIFu.js";
import "./tailscale-C3JsBEiY.js";
import "./auth-DZSWPd8D.js";
import "./server-context-DAWsUNUs.js";
import "./frontmatter-6HZ0_y2V.js";
import "./skills-CLmzWt48.js";
import "./routes-DIQa_0pt.js";
import "./redact-B7Mjvk0c.js";
import "./errors-kfGqPQ4b.js";
import "./fs-safe-_OpKPuZA.js";
import "./paths-D1WZUYry.js";
import "./ssrf-6f5m2MMA.js";
import "./store-DSGYY-H9.js";
import "./ports-DwDxX6cS.js";
import "./trash-DLzIf__E.js";
import "./sessions-Z1BZU3xh.js";
import "./dock-7F-MiPtF.js";
import "./normalize-Ci8UyR3Z.js";
import "./accounts-Bj1dJ-fd.js";
import "./accounts-DOl1Wkxo.js";
import "./accounts-t6R5_PzC.js";
import "./bindings-Dja1z-h8.js";
import "./logging-xYH6GmRT.js";
import "./send-uu2Jc-Js.js";
import "./plugins-CKbXkuXd.js";
import "./paths-C2NfoGZE.js";
import "./tool-display-Bx4M6uNT.js";
import "./fetch-guard-C1sYsWgl.js";
import "./api-key-rotation-CpGefdGL.js";
import "./local-roots-DiDvXIIo.js";
import "./sqlite-JcMMx8Z5.js";
import "./model-catalog-CIixTnGt.js";
import "./tokens-D4lZk7-h.js";
import "./with-timeout-DijiQjw6.js";
import "./deliver-DgvS3uCz.js";
import "./diagnostic-UUwku4RV.js";
import "./diagnostic-session-state-ByqoIyGn.js";
import "./send-DbwyyQAv.js";
import "./model-VbWjwqaW.js";
import "./reply-prefix-DAK7-zK4.js";
import "./memory-cli-DxmtLhh_.js";
import "./manager-C0teWocQ.js";
import "./retry-rUEdE6zT.js";
import "./chunk-CMylpCPi.js";
import "./markdown-tables-B9VGUdDc.js";
import "./ir-24qCLTKH.js";
import "./render-CXDO_kgw.js";
import "./commands-registry-bb_U-3FM.js";
import "./client-BdSkEtCd.js";
import "./call-BCz_8mqq.js";
import "./pairing-token-B-_eiWlR.js";
import "./channel-activity-DynIQUB_.js";
import "./fetch-Bu5zBCce.js";
import "./tables-C70h_80U.js";
import "./send-CAfFUUkm.js";
import "./pairing-store-T5DpOfoL.js";
import "./proxy-BiOWrea2.js";
import { t as formatDocsLink } from "./links-BVCMOGeE.js";
import { n as runCommandWithRuntime } from "./cli-utils-CX1oQ81G.js";
import "./help-format-dbk2xW0E.js";
import "./progress-CaVMHLaE.js";
import "./resolve-route-2TU_aaLs.js";
import "./replies-NhrZJ3yf.js";
import "./skill-commands-N8Sho46-.js";
import "./workspace-dirs-CE3CxabZ.js";
import "./pi-tools.policy-DTy1DnPK.js";
import "./outbound-attachment-CntoLTI_.js";
import "./delivery-queue-CxDDEWQg.js";
import "./session-cost-usage-BlUDaylg.js";
import "./send-4LoRaltQ.js";
import "./onboard-helpers-DbjfBSMX.js";
import "./prompt-style-VqCNjBi8.js";
import "./pairing-labels-DaESq9ML.js";
import "./exec-approvals-q0C8VDMT.js";
import "./nodes-screen-5fMfTT2n.js";
import "./control-service-BoO2TGOx.js";
import "./stagger-B6VQyn1F.js";
import "./channel-selection-DuDSoVSC.js";
import "./runtime-guard-DlT3NecY.js";
import "./note-C-OTWf0F.js";
import "./clack-prompter-C8qX15zH.js";
import "./daemon-runtime-CZuP7tS4.js";
import "./systemd-B6S4ND7H.js";
import "./service-Bw9h81em.js";
import "./health-Bt3xmMjK.js";
import "./onboarding-DeU1kIgp.js";
import "./shared-B-zggieW.js";
import "./auth-token-CliHE70g.js";
import "./logging-Cl6-FWdR.js";
import { n as formatAuthChoiceChoicesForCli } from "./auth-choice-options-DewcBvrX.js";
import "./openai-model-default-8jds2v9m.js";
import "./vllm-setup-G6R-Hqd8.js";
import "./systemd-linger-C3Tnphf9.js";
import "./model-picker-C9zrudfS.js";
import "./onboard-custom-DQu1PmgP.js";
import { n as ONBOARD_PROVIDER_AUTH_FLAGS, t as onboardCommand } from "./onboard-cNHf-thX.js";
//#region src/cli/program/register.onboard.ts
function resolveInstallDaemonFlag(command, opts) {
if (!command || typeof command !== "object") return;
const getOptionValueSource = "getOptionValueSource" in command ? command.getOptionValueSource : void 0;
if (typeof getOptionValueSource !== "function") return;
if (getOptionValueSource.call(command, "skipDaemon") === "cli") return false;
if (getOptionValueSource.call(command, "installDaemon") === "cli") return Boolean(opts.installDaemon);
}
const AUTH_CHOICE_HELP = formatAuthChoiceChoicesForCli({
includeLegacyAliases: true,
includeSkip: true
});
function registerOnboardCommand(program) {
const command = program.command("onboard").description("Interactive wizard to set up the gateway, workspace, and skills").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/onboard", "docs.openclaw.ai/cli/onboard")}\n`).option("--workspace <dir>", "Agent workspace directory (default: ~/.openclaw/workspace)").option("--reset", "Reset config + credentials + sessions + workspace before running wizard").option("--non-interactive", "Run without prompts", false).option("--accept-risk", "Acknowledge that agents are powerful and full system access is risky (required for --non-interactive)", false).option("--flow <flow>", "Wizard flow: quickstart|advanced|manual").option("--mode <mode>", "Wizard mode: local|remote").option("--auth-choice <choice>", `Auth: ${AUTH_CHOICE_HELP}`).option("--token-provider <id>", "Token provider id (non-interactive; used with --auth-choice token)").option("--token <token>", "Token value (non-interactive; used with --auth-choice token)").option("--token-profile-id <id>", "Auth profile id (non-interactive; default: <provider>:manual)").option("--token-expires-in <duration>", "Optional token expiry duration (e.g. 365d, 12h)").option("--cloudflare-ai-gateway-account-id <id>", "Cloudflare Account ID").option("--cloudflare-ai-gateway-gateway-id <id>", "Cloudflare AI Gateway ID");
for (const providerFlag of ONBOARD_PROVIDER_AUTH_FLAGS) command.option(providerFlag.cliOption, providerFlag.description);
command.option("--custom-base-url <url>", "Custom provider base URL").option("--custom-api-key <key>", "Custom provider API key (optional)").option("--custom-model-id <id>", "Custom provider model ID").option("--custom-provider-id <id>", "Custom provider ID (optional; auto-derived by default)").option("--custom-compatibility <mode>", "Custom provider API compatibility: openai|anthropic (default: openai)").option("--gateway-port <port>", "Gateway port").option("--gateway-bind <mode>", "Gateway bind: loopback|tailnet|lan|auto|custom").option("--gateway-auth <mode>", "Gateway auth: token|password").option("--gateway-token <token>", "Gateway token (token auth)").option("--gateway-password <password>", "Gateway password (password auth)").option("--remote-url <url>", "Remote Gateway WebSocket URL").option("--remote-token <token>", "Remote Gateway token (optional)").option("--tailscale <mode>", "Tailscale: off|serve|funnel").option("--tailscale-reset-on-exit", "Reset tailscale serve/funnel on exit").option("--install-daemon", "Install gateway service").option("--no-install-daemon", "Skip gateway service install").option("--skip-daemon", "Skip gateway service install").option("--daemon-runtime <runtime>", "Daemon runtime: node|bun").option("--skip-channels", "Skip channel setup").option("--skip-skills", "Skip skills setup").option("--skip-health", "Skip health check").option("--skip-ui", "Skip Control UI/TUI prompts").option("--node-manager <name>", "Node manager for skills: npm|pnpm|bun").option("--json", "Output JSON summary", false);
command.action(async (opts, commandRuntime) => {
await runCommandWithRuntime(defaultRuntime, async () => {
const installDaemon = resolveInstallDaemonFlag(commandRuntime, { installDaemon: Boolean(opts.installDaemon) });
const gatewayPort = typeof opts.gatewayPort === "string" ? Number.parseInt(opts.gatewayPort, 10) : void 0;
await onboardCommand({
workspace: opts.workspace,
nonInteractive: Boolean(opts.nonInteractive),
acceptRisk: Boolean(opts.acceptRisk),
flow: opts.flow,
mode: opts.mode,
authChoice: opts.authChoice,
tokenProvider: opts.tokenProvider,
token: opts.token,
tokenProfileId: opts.tokenProfileId,
tokenExpiresIn: opts.tokenExpiresIn,
anthropicApiKey: opts.anthropicApiKey,
openaiApiKey: opts.openaiApiKey,
openrouterApiKey: opts.openrouterApiKey,
aiGatewayApiKey: opts.aiGatewayApiKey,
cloudflareAiGatewayAccountId: opts.cloudflareAiGatewayAccountId,
cloudflareAiGatewayGatewayId: opts.cloudflareAiGatewayGatewayId,
cloudflareAiGatewayApiKey: opts.cloudflareAiGatewayApiKey,
moonshotApiKey: opts.moonshotApiKey,
kimiCodeApiKey: opts.kimiCodeApiKey,
geminiApiKey: opts.geminiApiKey,
zaiApiKey: opts.zaiApiKey,
xiaomiApiKey: opts.xiaomiApiKey,
qianfanApiKey: opts.qianfanApiKey,
minimaxApiKey: opts.minimaxApiKey,
syntheticApiKey: opts.syntheticApiKey,
veniceApiKey: opts.veniceApiKey,
togetherApiKey: opts.togetherApiKey,
huggingfaceApiKey: opts.huggingfaceApiKey,
opencodeZenApiKey: opts.opencodeZenApiKey,
xaiApiKey: opts.xaiApiKey,
litellmApiKey: opts.litellmApiKey,
customBaseUrl: opts.customBaseUrl,
customApiKey: opts.customApiKey,
customModelId: opts.customModelId,
customProviderId: opts.customProviderId,
customCompatibility: opts.customCompatibility,
gatewayPort: typeof gatewayPort === "number" && Number.isFinite(gatewayPort) ? gatewayPort : void 0,
gatewayBind: opts.gatewayBind,
gatewayAuth: opts.gatewayAuth,
gatewayToken: opts.gatewayToken,
gatewayPassword: opts.gatewayPassword,
remoteUrl: opts.remoteUrl,
remoteToken: opts.remoteToken,
tailscale: opts.tailscale,
tailscaleResetOnExit: Boolean(opts.tailscaleResetOnExit),
reset: Boolean(opts.reset),
installDaemon,
daemonRuntime: opts.daemonRuntime,
skipChannels: Boolean(opts.skipChannels),
skipSkills: Boolean(opts.skipSkills),
skipHealth: Boolean(opts.skipHealth),
skipUi: Boolean(opts.skipUi),
nodeManager: opts.nodeManager,
json: Boolean(opts.json)
}, defaultRuntime);
});
});
}
//#endregion
export { registerOnboardCommand };