Download packages/console/core/script/promote-limits.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 658 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/console/core/script/promote-limits.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/console/core/script/promote-limits.ts
-
curl -L -o promote-limits.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/console/core/script/promote-limits.ts
658 Bytes
| import { $ } from "bun" | |
| import path from "path" | |
| import { Subscription } from "../src/subscription" | |
| const stage = process.argv[2] | |
| if (!stage) throw new Error("Stage is required") | |
| const root = path.resolve(process.cwd(), "..", "..", "..") | |
| // read the secret | |
| const ret = await $`bun sst secret list --fallback`.cwd(root).text() | |
| const lines = ret.split("\n") | |
| const value = lines.find((line) => line.startsWith("ZEN_LIMITS"))?.split("=")[1] | |
| if (!value) throw new Error("ZEN_LIMITS not found") | |
| // validate value | |
| Subscription.validate(JSON.parse(value)) | |
| // update the secret | |
| await $`bun sst secret set ZEN_LIMITS ${value} --stage ${stage}` | |