Skip to content

Read a git marketplace's marketplace.json from a subdirectory - #5405

Merged
SawyerHood merged 1 commit into
mainfrom
marketplace-git-subdirectory
Oct 12, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
marketplace-git-subdirectory

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

A git marketplace could only keep marketplace.json at the repository root. materializeGit cloned the repository and read <checkout>/marketplace.json, with no way to name another directory. A repository that holds plugins for several agent tools could not keep its bb files together in one folder (#5372).

What changed

bb marketplace add git:<url>[@<ref>] --subdirectory <path> reads marketplace.json and relative icons from that directory of the checkout.

  • Server: plugin_marketplaces gains a nullable source_git_subdirectory column (migration 0142). The add route accepts an optional subdirectory, and every refresh reuses the stored value. The path follows the rules of bb plugin install --subdirectory: relative, no .., no .git, and no symlink out of the checkout. A subdirectory on an https or path: source is refused.
  • Contract and SDK: PluginMarketplace gains subdirectory: string | null, and plugins.marketplaces.add accepts subdirectory. The contract change alters the plugin SDK's bundled types, so the SDK version moves to 0.6.41.
  • CLI: bb marketplace add --subdirectory <path>. bb marketplace list shows a Subdirectory column when a marketplace has one.
  • Settings: a Subdirectory field appears under the source field once the source starts with git:, and each marketplace row shows its subdirectory.
  • Docs: the CLI guide, the bb-cli and plugin-authoring skill references, and docs/configuration.md.

Deviations from the issue's proposal:

  • Relative screenshot URLs are still skipped for git marketplaces, as they are for every non-https source. Only icons resolve next to the manifest.
  • marketplace.json and icons must resolve inside the subdirectory, not only inside the checkout.
  • source stays git:<url>@<ref> and the subdirectory is a separate field, matching bb plugin install --subdirectory, instead of a #<path> suffix.

source.git.subdir in catalog entries stays relative to the repository root. No HOST_DAEMON_PROTOCOL_VERSION change: nothing crosses the server/daemon wire.

How you verified

  • New server tests against a real git repository: add and refresh from a nested subdirectory, the root still read when no subdirectory is given, seven refused paths, a symlink out of the checkout (skipped on Windows), and a subdirectory on https and path: sources. Each failure leaves no staged checkout behind.
  • New route, CLI output, and Settings component tests for the request body, the list column, and the Subdirectory field.
  • pnpm exec turbo run typecheck lint --continue --filter='...[origin/main]'
  • pnpm exec turbo run test for @bb/server (plugin-catalog suites), @bb/db, @bb/sdk, @bb/server-contract, @bb/templates, @bb/domain, @bb/cli (marketplace output), and @bb/app (settings).
  • node packages/plugin-sdk/scripts/check-npm-version-guard.mjs passes with the version bump; it failed before the bump.
  • Against a dev server with a local repository that keeps its catalog in bb/: bb marketplace add git:<repo>@main --subdirectory bb, bb marketplace list, bb marketplace refresh after a new commit, the icon served from bb/icons/, and an add through Settings → Plugin marketplaces.

Fixes #5372

🤖 Generated with Claude Code

AGENT GENERATED

`bb marketplace add git:<url>[@<ref>] --subdirectory <path>` reads
marketplace.json and relative icons from that directory of the checkout
instead of the repository root, so a repository that holds plugins for
several tools can keep its bb files in one folder.

The subdirectory is stored in a new nullable
plugin_marketplaces.source_git_subdirectory column and reused on every
refresh. It follows the path rules of `bb plugin install --subdirectory`
and is refused for https and path: sources. The add route, the SDK, the
CLI, and Settings accept it; `bb marketplace list` and Settings show it.

The contract change alters the plugin SDK's bundled types, so the SDK
version moves to 0.6.41.

Fixes #5372

Co-Authored-By: Claude Code <[email protected]>
@SawyerHood
SawyerHood marked this pull request as ready for review October 12, 2026 21:59
@SawyerHood
SawyerHood merged commit 1c36191 into main Oct 12, 2026
88 of 89 checks passed
@SawyerHood
SawyerHood deleted the marketplace-git-subdirectory branch October 12, 2026 22:09
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.

Read a git marketplace's marketplace.json from a subdirectory

1 participant