Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/opencode/src/bun/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Log } from "../util/log"
import path from "path"
import { NamedError } from "@opencode-ai/util/error"
import { readableStreamToText } from "bun"
import { Config } from "../config/config"
import { createRequire } from "module"
import { Lock } from "../util/lock"

Expand Down Expand Up @@ -76,6 +77,12 @@ export namespace BunProc {
// Build command arguments
const args = ["add", "--force", "--exact", "--cwd", Global.Path.cache, pkg + "@" + version]

// Add --no-cache flag if configured
const config = await Config.get()
if (config.bun_no_cache) {
args.push("--no-cache")
}

// Let Bun handle registry resolution:
// - If .npmrc files exist, Bun will use them automatically
// - If no .npmrc files exist, Bun will default to https://registry.npmjs.org
Expand Down
4 changes: 4 additions & 0 deletions packages/opencode/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,10 @@ export namespace Config {
url: z.string().optional().describe("Enterprise URL"),
})
.optional(),
bun_no_cache: z
.boolean()
.optional()
.describe("Disable Bun cache when installing packages (adds --no-cache flag)"),
experimental: z
.object({
hook: z
Expand Down
Loading