SPB Git forge

spb/polyllm

Public
15commits 1branches 0releases
2.2 MBsize
maindefault branch
13 days agolast push
TypeScript 97.4% SQL 1% JavaScript 0.9% CSS 0.6%
893 B · 29 lines typescript
Raw Blame History
1/**2 * CLI: refresh the model registry with the owner keys from .env.3 *   pnpm models:sync            → all providers with a key4 *   pnpm models:sync anthropic  → one provider5 */6import "./load-env";7import { syncAllWithEnvKeys, syncProvider } from "@/lib/ai/registry";8import { closeDb } from "@/db";9import { isProviderId } from "@/lib/ai/core/types";10import { ownerKey } from "@/lib/ai/providers/env-keys";1112async function main() {13  const target = process.argv[2];14  if (target) {15    if (!isProviderId(target)) throw new Error(`Unknown provider ${target}`);16    const key = ownerKey(target);17    if (!key) throw new Error(`No key for ${target} in the environment`);18    console.table([await syncProvider(target, key, "cli")]);19  } else {20    console.table(await syncAllWithEnvKeys("cli"));21  }22  await closeDb();23}2425main().catch((e) => {26  console.error(e);27  process.exit(1);28});29