Skip to content

feat(claude): auto-sync extraKnownMarketplaces on plugin install/uninstall#36

Merged
bojanrajkovic merged 3 commits intomainfrom
feat/sync-extra-marketplaces
Mar 7, 2026
Merged

feat(claude): auto-sync extraKnownMarketplaces on plugin install/uninstall#36
bojanrajkovic merged 3 commits intomainfrom
feat/sync-extra-marketplaces

Conversation

@bojanrajkovic
Copy link
Copy Markdown
Contributor

Summary

  • Automatically reconcile extraKnownMarketplaces in project/local settings files after plugin install/uninstall operations, so team members who clone the repo get prompted to install missing marketplaces
  • Add polymorphic MarketplaceSource types (7 concrete source types) with discriminated union JSON serialization
  • Add SyncExtraMarketplaces with atomic writes via os.Root.Rename (Go 1.25) to safely update settings files
  • Read marketplace source data from ~/.claude/plugins/known_marketplaces.json

🤖 Generated with Claude Code

…stall

When plugins are installed or uninstalled at project or local scope,
automatically reconcile extraKnownMarketplaces in the corresponding
settings file. This ensures team members who clone the repo get prompted
to install missing marketplaces when they trust the folder.

Key changes:
- Add MarketplaceSource polymorphic types (7 concrete source types)
  with discriminated union JSON marshal/unmarshal
- Add SyncExtraMarketplaces with atomic write (temp file + os.Root.Rename)
- Add ReadKnownMarketplaces to read ~/.claude/plugins/known_marketplaces.json
- Hook syncMarketplaces() into TUI after all operations complete
- Upgrade to Go 1.25 for os.Root.Rename support

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bojanrajkovic
Copy link
Copy Markdown
Contributor Author

bojanrajkovic commented Mar 7, 2026

Test Plan

  • mise run ci passes (fmt, vet, lint, test, build)
  • Install plugin from ed3d-plugins to project scope → verify .claude/settings.json gains extraKnownMarketplaces.ed3d-plugins with correct source
  • Uninstall last ed3d-plugins plugin from project scope → verify extraKnownMarketplaces.ed3d-plugins removed
  • Install to user scope → verify no extraKnownMarketplaces changes in project/local settings
  • Verify existing settings fields (env, permissions, enabledPlugins, statusLine) preserved after write
  • Install multiple plugins from different marketplaces in one batch → verify single write with correct entries

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 7, 2026

PR Build

Version: 0.3.2-pr.36+57a96bc

Platform Archive
Linux (amd64) cpm-linux-amd64
Linux (arm64) cpm-linux-arm64
macOS (universal) cpm-macos-universal
Windows (amd64) cpm-windows-amd64

Download artifacts

Built from 492476a

bojanrajkovic and others added 2 commits March 7, 2026 08:12
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use strings.LastIndexByte in MarketplaceNameFromPluginID
- Have parsePluginID delegate to MarketplaceNameFromPluginID
- Use fs.ReadFile pattern in ReadKnownMarketplacesFrom
- Remove unnecessary os.MkdirAll before os.OpenRoot
- Move syncMarketplaces to tea.Cmd to avoid blocking UI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bojanrajkovic bojanrajkovic merged commit 35c38e2 into main Mar 7, 2026
6 checks passed
@bojanrajkovic bojanrajkovic deleted the feat/sync-extra-marketplaces branch March 7, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant