Skip to content

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

Description

@maxsumrall

The workflow

A private GitHub repository holds agent plugins for several agent tools. I want to add a bb marketplace to it and keep all bb files in one bb/ folder, apart from the other tools' files and CI:

bb/
  marketplace.json
  plugins/
    notes/
    status/

Catalog entries already point into that folder with source.git.subdir: "bb/plugins/notes". The catalog file is the one bb file that has to sit at the repository root.

What happens today

bb reads marketplace.json from the root of the checkout. materializeGit clones the repository and passes the checkout root to materializeLocal, which reads <root>/marketplace.json:

  • async function materializeGit(
    source: Extract<MarketplaceSource, { kind: "git" }>,
    stagingDir: string,
    warn: ((message: string) => void) | undefined,
    ): Promise<MaterializedMarketplace> {
    await mkdir(stagingDir, { recursive: true });
    const checkout = join(stagingDir, randomUUID());
    const dispose = () => rm(checkout, { recursive: true, force: true });
    try {
    await runInstallCommand("git", [
    ...GIT_CLONE_ARGS,
    "clone",
    "--quiet",
    "--no-checkout",
    source.url,
    checkout,
    ]);
    await runInstallCommand("git", [
    ...GIT_CLONE_ARGS,
    "-C",
    checkout,
    "checkout",
    "--quiet",
    "--detach",
    source.ref,
    ]);
    const commit = await runInstallCommand("git", [
    "-C",
    checkout,
    "rev-parse",
    "HEAD",
    ]);
    await rm(join(checkout, ".git"), { recursive: true, force: true });
    return await materializeLocal(checkout, commit, dispose, warn);
    } catch (error) {
    await dispose();
    throw error;
  • async function materializeLocal(
    root: string,
    commit: string | null,
    dispose: () => Promise<void>,
    warn: ((message: string) => void) | undefined,
    ): Promise<MaterializedMarketplace> {
    try {
    const isDirectory = await stat(root)
    .then((entry) => entry.isDirectory())
    .catch(() => false);
    if (!isDirectory) {
    throw new Error(`marketplace directory does not exist: ${root}`);
    }
    const manifestPath = await realPathInside(
    root,
    join(root, MARKETPLACE_MANIFEST_FILENAME),

The other source forms do not cover a private repository. bb fetches an https:// manifest without credentials, so raw.githubusercontent.com answers 404 for a private file. A path: source needs a local clone on each machine that someone keeps current by hand.

What you would expect

bb marketplace add git:https://github.com/acme/agent-plugins.git@main --subdirectory bb

bb reads <checkout>/bb/marketplace.json and:

  • stores the subdirectory with the marketplace, reuses it on each refresh, and shows it in bb marketplace list and Settings → Plugin marketplaces
  • resolves relative icon and screenshot URLs against the subdirectory, next to the manifest
  • keeps source.git.subdir in entries relative to the repository root, as today
  • applies the path rules of bb plugin install --subdirectory: a relative path, no .., no symlink out of the checkout

The flag name matches bb plugin install --subdirectory from #1097. If you prefer one string for the single Settings field, a suffix such as git:<url>@main#bb would work too.

Context and alternatives

AGENT GENERATED

Activity

  1. added
    plugins
    cli
    on Oct 12, 2026
  2. bb-slop-cop commented on Oct 12, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied missing classifications:

    • Type: Feature
    • Priority: Medium — useful repository-layout support with existing workarounds; no outage or data-loss risk.
    • Effort: High — requires persisted source configuration and coordinated server, CLI, and Settings changes.
    • Labels: plugins, cli

    Trusted main-branch code supports a git URL and ref but no catalog subdirectory. This adds functionality rather than fixes unexpected behavior. Final Type verified as Feature; bug reporting and automated fixes skipped. No pull request opened because this is a feature request requiring a stored-data change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliplugins

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions