Files
opencode/packages
Claude e320484774 perf: lazy-load CLI commands via dynamic import for code splitting
Replace 23 static command imports with lazy-loaded dynamic imports.
Each command's heavy dependencies (Provider, Session, MCP, TUI, AI SDKs)
are now only loaded when that specific command is invoked.

Combined with the Rollup tree-shaking pre-pass, this produces 45 chunks
instead of a single bundle. The entry chunk (what loads on startup) drops
from ~9.8MB to ~120KB — a 98.8% reduction in startup load.

- Add `lazyCmd` helper to `cli/cmd/cmd.ts` for type-safe lazy commands
- Inline all builder options (yargs metadata) in `index.ts`
- Dynamic `import()` in handlers defers heavy module loading
- `opencode --help` / `--version` no longer loads AI SDK, MCP, TUI, etc.

https://claude.ai/code/session_01R7zMpXjsq1R6uR7xpyJ14i
2026-04-16 13:03:44 +00:00
..
2026-04-15 07:26:23 +00:00
2026-04-16 07:15:05 +00:00
2026-04-16 02:03:03 -04:00