feat(upgrade): prompt to update editor plugins after CLI upgrade#334
Merged
Conversation
After a successful CLI upgrade, offer to update editor plugins: - TTY: confirm prompt, then editor selection - Non-TTY (agent): auto-update all detected editors - --plugins flag: skip prompt, auto-update all detected Gracefully handles missing credentials (login hint), no editors detected (manual hint), and install failures (non-fatal report). Reuses installForEditor/printManualInstructions from plugin/install by exporting them for cross-command sharing. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Deploying archgate-cli with
|
| Latest commit: |
97f15ed
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://626d5b83.archgate-cli.pages.dev |
| Branch Preview URL: | https://feat-upgrade-plugin-prompt.archgate-cli.pages.dev |
Write `~/.config/opencode/opencode.json` with `default_agent` set to `archgate-developer` during `archgate init --editor opencode` and `archgate plugin install --editor opencode`. Follows the same additive merge pattern as claude-settings.ts: - Sets `default_agent` only if absent (never overwrites user's choice) - Preserves all existing user config keys - Creates parent directories if missing Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Consolidate the opencode.json config write into the single install function so it runs from every entry point (init, plugin install, upgrade --plugins) without duplicate calls. The function is already idempotent — it only sets default_agent if absent. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Move all imports used only by maybeUpdatePlugins to dynamic import() calls inside the function body. This avoids parsing credential-store, editor-detect, init-project, plugin/install, and prompt modules on code paths that never reach the plugin update flow (--help, --version, already up-to-date, upgrade failure). Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
…ution Replace the fragile dirname(opencodeAgentsDir()) derivation with an explicit opencodeConfigDir() in paths.ts. Both opencodeAgentsDir() and opencodeConfigPath() now derive from the same base, removing the coupling between the agents subdirectory and the config path. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Re-add the Cursor Team Marketplace and opencode CLI guard comments that were accidentally stripped from installForEditor during the export refactor. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
The "loop over editors, collect failures, report with manual
instructions" block was duplicated between plugin install and
upgrade --plugins. Extract it into runPluginInstalls(editors, token,
verb) in plugin/install.ts so both callers share the same logic.
The verb parameter ("install" vs "update") customizes the error
message.
Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plugin update prompt after upgrade:
archgate upgrade, the CLI now offers to update editor plugins--pluginsflag: Skips the prompt and auto-updates all detected editorsopencode default agent configuration:
archgate init --editor opencodeandarchgate plugin install --editor opencode, writesopencode.jsonto~/.config/opencode/withdefault_agent: "archgate-developer"default_agentif absent (never overwrites user's choice), preserves all existing configTest plan
bun run validatepasses (lint, typecheck, format, 1141 tests, 27/27 ADR checks, knip, build)maybeUpdatePluginscovering: no credentials, no editors,--pluginsflag, non-TTY auto-update, install failure reportingarchgate upgradewhen already up-to-date does NOT prompt for pluginsarchgate upgrade --pluginswith credentials auto-updates detected editorsarchgate init --editor opencodecreatesopencode.jsonwithdefault_agent