Skip to content

Conversation

@devxoul
Copy link
Contributor

@devxoul devxoul commented Dec 18, 2025

Summary

  • Improves OpenCode startup time by instructing users to install with exact version (e.g., [email protected]) instead of unversioned package name
  • Updates installation scripts to automatically fetch latest version from npm before installation
  • Applied to all three README files (EN, KO, JA)

Why

Without version specification, npm/bun checks the registry for the latest version on every OpenCode launch, causing slower startup times.

- Add step to check latest version via npm before installation
- Update shell scripts to automatically fetch and use latest version
- Improves OpenCode startup time by avoiding version resolution on each launch
@devxoul devxoul marked this pull request as draft December 18, 2025 03:49
@devxoul devxoul marked this pull request as ready for review December 18, 2025 03:55
@code-yeongyu
Copy link
Owner

By the approach you took the auto update would be disabled forever I think?

@code-yeongyu
Copy link
Owner

Without version specification, npm/bun checks the registry for the latest version on every OpenCode launch, causing slower startup times.

Is that actually true? Because I thought there might be small delay but not huge

@devxoul
Copy link
Contributor Author

devxoul commented Dec 18, 2025

Is that actually true? Because I thought there might be small delay but not huge

Yeah, you may check the source code at plugin/index.ts:37-40:

const lastAtIndex = plugin.lastIndexOf("@")
const pkg = lastAtIndex > 0 ? plugin.substring(0, lastAtIndex) : plugin
const version = lastAtIndex > 0 ? plugin.substring(lastAtIndex + 1) : "latest"
plugin = await BunProc.install(pkg, version)

This will execute bun install with @latest which will always check for the latest version of each plugins. No cache will be used.

By the approach you took the auto update would be disabled forever I think?

You can still add some background job to check if there's latest version exists.

@code-yeongyu
Copy link
Owner

Looks nice but currently by merging this It'll break the auto update- so I'll merge this after background update feature is implemented (soon)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants