This guide explains how to keep your OpenCode framework installation up to date, switch between installation modes, and troubleshoot common issues.
In copy mode, the framework is downloaded and extracted without git tracking. To update:
curl -fsSL https://apiad.github.io/opencode/install.sh | bashThe installer will:
- Detect the existing
.opencode/directory - Clone the latest version from the repository
- Preserve your protected files (
opencode.json,.opencode/style-guide.md) - Show you what will be updated before proceeding
To update to a specific version:
curl -fsSL https://apiad.github.io/opencode/install.sh | bash -s -- --version v2.0.0In link mode, the framework is installed as a git submodule. To update:
cd .opencode && git fetch && git checkout vX.Y.ZOr use the installer to update the submodule:
curl -fsSL https://apiad.github.io/opencode/install.sh | bash -s -- --link --updateRun the installer with --link:
curl -fsSL https://apiad.github.io/opencode/install.sh | bash -s -- --linkNote: This will convert your installation to a git submodule.
Run the installer with --copy:
curl -fsSL https://apiad.github.io/opencode/install.sh | bash -s -- --copyNote: This will remove the
.git/directory from the framework, breaking the submodule connection. Your customizations will be preserved.
The framework repository (opencode-core) is tracked as a submodule. To update to a specific version:
cd .opencode
git fetch origin
git checkout v2.0.0
cd ..
git add .opencode
git commit -m "chore: update opencode-core to v2.0.0"To switch back to the latest from a branch:
cd .opencode
git checkout mainSimply re-run the installer. It will download the latest version and preserve your configurations.
If an update causes issues:
- Check the changelog - Review
.opencode/CHANGELOG.mdfor breaking changes - Run diagnostics:
make doctor
- Check for dependency updates:
make install-deps
Since copy mode doesn't track git history, you cannot rollback automatically. To restore a previous state:
- Identify the version you need from the installer changelog
- Reinstall that specific version:
curl -fsSL https://apiad.github.io/opencode/install.sh | bash -s -- --version v1.9.0
Git submodules preserve history. To rollback:
cd .opencode
git log --oneline # Find the previous commit
git checkout v1.9.0 # Rollback to previous version
cd ..
git add .opencode
git commit -m "chore: rollback opencode-core to v1.9.0"To find available versions:
cd .opencode
git tag -l # List all available versionsIf your installation is corrupted:
-
Remove the framework directory:
rm -rf .opencode
-
Reinstall:
curl -fsSL https://apiad.github.io/opencode/install.sh | bash -s -- --copy -
Restore your configurations from backups (if available in
~/.opencode/)
- Documentation: See other files in
/docs/ - Issues: Report bugs at https://github.com/apiad/opencode/issues
- Framework Repo: https://github.com/apiad/opencode-core
See deploy.md for information about installation modes and when to use each.