summaryrefslogtreecommitdiffhomepage
path: root/packages/console/core/script/pull-models.ts
diff options
context:
space:
mode:
authorFrank <[email protected]>2026-01-30 12:19:36 -0500
committerGitHub <[email protected]>2026-01-30 12:19:36 -0500
commit7cb84f13d3b73c6bd6e6f7949bb952da1af3f2be (patch)
tree5374a7eb115c43478e925f25d8e64b7d2167787f /packages/console/core/script/pull-models.ts
parent1aade4b30817b8ecd2edb708737ed554879c2f28 (diff)
downloadopencode-7cb84f13d3b73c6bd6e6f7949bb952da1af3f2be.tar.gz
opencode-7cb84f13d3b73c6bd6e6f7949bb952da1af3f2be.zip
wip: zen (#11343)
Diffstat (limited to 'packages/console/core/script/pull-models.ts')
-rwxr-xr-xpackages/console/core/script/pull-models.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/console/core/script/pull-models.ts b/packages/console/core/script/pull-models.ts
index f360b8186..6e89f602b 100755
--- a/packages/console/core/script/pull-models.ts
+++ b/packages/console/core/script/pull-models.ts
@@ -2,20 +2,21 @@
import { $ } from "bun"
import path from "path"
+import os from "os"
import { ZenData } from "../src/model"
const stage = process.argv[2]
if (!stage) throw new Error("Stage is required")
const root = path.resolve(process.cwd(), "..", "..", "..")
-const PARTS = 8
+const PARTS = 10
// read the secret
const ret = await $`bun sst secret list --stage ${stage}`.cwd(root).text()
const lines = ret.split("\n")
const values = Array.from({ length: PARTS }, (_, i) => {
const value = lines
- .find((line) => line.startsWith(`ZEN_MODELS${i + 1}`))
+ .find((line) => line.startsWith(`ZEN_MODELS${i + 1}=`))
?.split("=")
.slice(1)
.join("=")
@@ -27,6 +28,6 @@ const values = Array.from({ length: PARTS }, (_, i) => {
ZenData.validate(JSON.parse(values.join("")))
// update the secret
-for (let i = 0; i < PARTS; i++) {
- await $`bun sst secret set ZEN_MODELS${i + 1} -- ${values[i]}`
-}
+const envFile = Bun.file(path.join(os.tmpdir(), `models-${Date.now()}.env`))
+await envFile.write(values.map((v, i) => `ZEN_MODELS${i + 1}=${v}`).join("\n"))
+await $`bun sst secret load ${envFile.name}`.cwd(root)