fix(cli): repair install/upgrade/docker paths and accept bolt configs - #34
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
📝 WalkthroughWalkthroughThe CLI is rebranded from OpenCode to Bolt across installation, upgrade, uninstall, Docker packaging, and user-facing messages. Configuration discovery now supports Bolt files and directories while continuing to load legacy OpenCode configurations. ChangesBolt migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
The following comment was made by an LLM, it may be inaccurate: |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/opencode/src/config/config.ts`:
- Around line 261-263: Reorder the configuration loading flow around the Bolt
merge calls and the legacy TOML migration so the migration completes before
loading and merging bolt.json and bolt.jsonc. Preserve the existing merge order
between the two Bolt files and ensure Bolt values take precedence on both
first-run and subsequent loads.
In `@packages/opencode/src/installation/index.ts`:
- Around line 187-189: Complete the package-name migration across the
installation resolver and upgrade flows: update the Brew resolver plus
Chocolatey and Scoop latest/upgrade branches to use Bolt consistently, matching
the detection commands in the shown entries. Retain “opencode” only where it is
an explicit legacy fallback, not as the primary package identifier or endpoint.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ad7cc1c6-5575-44f7-9128-6d041e75061c
📒 Files selected for processing (8)
installpackages/opencode/Dockerfilepackages/opencode/src/cli/cmd/uninstall.tspackages/opencode/src/config/config.tspackages/opencode/src/config/paths.tspackages/opencode/src/config/tui.tspackages/opencode/src/installation/index.tspackages/opencode/test/config/config.test.ts
| // bolt configs load last so they win over legacy opencode configs | ||
| result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "bolt.json"), env)) | ||
| result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "bolt.jsonc"), env)) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Move Bolt merges after legacy TOML migration.
The legacy config migration below still merges its values after these Bolt files, so when both sources exist, legacy TOML overrides Bolt during the first load despite the “bolt configs load last” contract. Move the migration before these merges, or reapply Bolt afterward, to keep first-run and subsequent precedence consistent.
Proposed ordering
- // bolt configs load last so they win over legacy opencode configs
- result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "bolt.json"), env))
- result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "bolt.jsonc"), env))
-
const legacy = path.join(Global.Path.config, "config")
if (existsSync(legacy)) {
// existing migration
}
+
+ // bolt configs load last so they win over legacy opencode configs
+ result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "bolt.json"), env))
+ result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "bolt.jsonc"), env))📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // bolt configs load last so they win over legacy opencode configs | |
| result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "bolt.json"), env)) | |
| result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "bolt.jsonc"), env)) | |
| const legacy = path.join(Global.Path.config, "config") | |
| if (existsSync(legacy)) { | |
| // existing migration | |
| } | |
| // bolt configs load last so they win over legacy opencode configs | |
| result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "bolt.json"), env)) | |
| result = mergeConfig(result, yield* loadFile(path.join(Global.Path.config, "bolt.jsonc"), env)) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/opencode/src/config/config.ts` around lines 261 - 263, Reorder the
configuration loading flow around the Bolt merge calls and the legacy TOML
migration so the migration completes before loading and merging bolt.json and
bolt.jsonc. Preserve the existing merge order between the two Bolt files and
ensure Bolt values take precedence on both first-run and subsequent loads.
| { name: "brew", command: () => text(["brew", "list", "--formula", "bolt"]) }, | ||
| { name: "scoop", command: () => text(["scoop", "list", "bolt"]) }, | ||
| { name: "choco", command: () => text(["choco", "list", "--limit-output", "bolt"]) }, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Complete the Brew/Chocolatey/Scoop migration.
Lines 187–189 detect Bolt installs, but the subsequent Brew resolver and the Chocolatey/Scoop latest and upgrade branches still use opencode. Those users will resolve or upgrade the legacy package instead of Bolt. Update those identifiers/endpoints together, retaining legacy values only as explicit fallback support.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/opencode/src/installation/index.ts` around lines 187 - 189, Complete
the package-name migration across the installation resolver and upgrade flows:
update the Brew resolver plus Chocolatey and Scoop latest/upgrade branches to
use Bolt consistently, matching the detection commands in the shown entries.
Retain “opencode” only where it is an explicit legacy fallback, not as the
primary package identifier or endpoint.
Issue for this PR
Closes #35
Type of change
What does this PR do?
Fixes the remaining install-path breakage from the Bolt rename and adds dual config discovery, split into 7 per-file commits.
Install/upgrade/docker correctness (these break real users of v0.0.1):
Bolt-<target>.tar.gzwhile releases publishbolt-cli-<os>-<arch>.tar.gz|zip; it now uses the right asset prefix, handlesbolt.exeon Windows, and its usage/epilogue point at this repo instead of opencode.aiDockerfilecopieddist/opencode-linux-*(nonexistent) and ranopencode; nowdist/@bolt-builder/bolt-cli-linux-*withENTRYPOINT ["bolt"]bolt upgradefetched the upstream opencode.ai installer and installedopencode-aifrom npm; it now fetches this repo's installer, upgrades@bolt-builder/bolt-cli, and detects curl installs in~/.bolt/bin(legacy~/.opencode/binstill recognized). The installation client string is nowbolt/<channel>/<version>/<client>bolt uninstallcleaned only.opencodepaths and# opencodePATH markers while the installer writes~/.bolt/bin+# bolt; it now handles both generationsConfig dual-read (opencode configs keep working, bolt configs win):
bolt.json(c)loads afteropencode.json(c), so it takes precedence; fresh installs scaffoldbolt.jsoncbolt.json(c)andopencode.json(c), and.boltdirectories are discovered alongside.opencode.boltdirectories as wellThese fixes work because each change points an existing code path at the names the build and release pipeline actually produces (
bolt-cli-<os>-<arch>assets,dist/@bolt-builder/bolt-cli-linux-*,@bolt-builder/bolt-clion npm,~/.bolt/bin), while keeping the legacy opencode names recognized for reads and cleanup so existing installs and configs are not broken.How did you verify your code works?
Added unit tests in
packages/opencode/test/config/config.test.tscovering dual config discovery and precedence (bolt over opencode), and validated the branch via CI. The installer and Dockerfile changes were checked against the asset names produced bypackages/opencode/script/build.ts.Screenshots / recordings
Not a UI change.
Checklist