diff options
| author | Aiden Cline <[email protected]> | 2025-11-24 14:32:38 -0600 |
|---|---|---|
| committer | Aiden Cline <[email protected]> | 2025-11-24 14:32:38 -0600 |
| commit | a9a2c23736bafda2d316ce7d667772e3cbe36bd5 (patch) | |
| tree | 047cae2c8544e9552ff30f0f2e715de461fae28d /packages | |
| parent | ccde319937b7ffb84aadd283a260bfe0f98c9bbb (diff) | |
| download | opencode-a9a2c23736bafda2d316ce7d667772e3cbe36bd5.tar.gz opencode-a9a2c23736bafda2d316ce7d667772e3cbe36bd5.zip | |
add autoupdate: notify
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/cli/upgrade.ts | 3 | ||||
| -rw-r--r-- | packages/opencode/src/config/config.ts | 7 | ||||
| -rw-r--r-- | packages/sdk/js/src/gen/types.gen.ts | 4 | ||||
| -rw-r--r-- | packages/web/src/content/docs/config.mdx | 2 |
4 files changed, 13 insertions, 3 deletions
diff --git a/packages/opencode/src/cli/upgrade.ts b/packages/opencode/src/cli/upgrade.ts index ca5cba27c..2bea760b3 100644 --- a/packages/opencode/src/cli/upgrade.ts +++ b/packages/opencode/src/cli/upgrade.ts @@ -10,6 +10,9 @@ export async function upgrade() { if (Installation.VERSION === latest) return if (config.autoupdate === false || Flag.OPENCODE_DISABLE_AUTOUPDATE) { + return + } + if (config.autoupdate === "notify") { await Bus.publish(Installation.Event.UpdateAvailable, { version: latest }) return } diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index 837899be5..79f969eea 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -479,7 +479,12 @@ export namespace Config { .boolean() .optional() .describe("@deprecated Use 'share' field instead. Share newly created sessions automatically"), - autoupdate: z.boolean().optional().describe("Automatically update to the latest version"), + autoupdate: z + .union([z.boolean(), z.literal("notify")]) + .optional() + .describe( + "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications", + ), disabled_providers: z.array(z.string()).optional().describe("Disable providers that are loaded automatically"), enabled_providers: z .array(z.string()) diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts index e2e611db1..3ba41cc23 100644 --- a/packages/sdk/js/src/gen/types.gen.ts +++ b/packages/sdk/js/src/gen/types.gen.ts @@ -1021,9 +1021,9 @@ export type Config = { */ autoshare?: boolean /** - * Automatically update to the latest version + * Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications */ - autoupdate?: boolean + autoupdate?: boolean | "notify" /** * Disable providers that are loaded automatically */ diff --git a/packages/web/src/content/docs/config.mdx b/packages/web/src/content/docs/config.mdx index 68f75b7a6..46d0d8268 100644 --- a/packages/web/src/content/docs/config.mdx +++ b/packages/web/src/content/docs/config.mdx @@ -267,6 +267,8 @@ OpenCode will automatically download any new updates when it starts up. You can } ``` +If you don't want updates but want to be notified when a new version is available, set `autoupdate` to `"notify"`. + --- ### Formatters |
