Skip to content

Append .git to the marketplace add command's repo URL - #3

Open
riverma wants to merge 1 commit into
mainfrom
fix/marketplace-add-git-suffix
Open

riverma wants to merge 1 commit into
mainfrom
fix/marketplace-add-git-suffix

Conversation

@riverma

@riverma riverma commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Follow-up to Fix install command URL for GitHub Enterprise Server deployments #2 (merged), which fixed getRepositoryInfo()'s fallback branch to derive the correct host URL instead of hardcoding github.com.
  • That fix alone wasn't sufficient for GitHub Enterprise Server deployments behind SSO: /plugin marketplace add <url> first tries the bare URL as a hosted marketplace.json source. On github.com, an unauthenticated fetch of a private/internal repo URL 404s, so Claude Code falls back to git clone-ing it. On a GHE instance behind SSO, the same fetch can return HTTP 200 with the SSO login page's HTML instead of a 404 — so Claude Code never falls back, and instead tries to parse that HTML as the marketplace.json object, failing with Invalid input: expected object, received string.
  • Appending .git to the URL makes it unambiguously a git source, so Claude Code skips the JSON-fetch attempt and clones directly.

Found while deploying a GHE-hosted fork of this framework: /plugin marketplace add failed with exactly the error above until this fix was applied.

Test plan

  • npm run build succeeds with no errors
  • Reproduced the exact error against a real GitHub Enterprise Server deployment with the un-suffixed URL
  • Confirmed /plugin marketplace add <url>.git succeeds against the same deployment once the suffix is added
  • Verified the change doesn't affect the live nasa-ammos.github.io/slim deployment — tested /plugin marketplace add against nasa-ammos/slim both with and without the .git suffix; both succeed identically on github.com

AI-generated: primarily produced by an AI model

Model: Claude Sonnet 5

A previous fix made getRepositoryInfo()'s githubUrl point at the
right host, but /plugin marketplace add can still fail on GitHub
Enterprise Server deployments behind SSO with "Invalid marketplace
schema from URL: Invalid input: expected object, received string".

Claude Code tries a bare URL as a hosted marketplace.json source
first. On github.com, an unauthenticated fetch of a repo URL 404s and
it falls back to git-cloning the URL. On a GitHub Enterprise Server
instance behind SSO, the same unauthenticated fetch can return HTTP
200 with the SSO login page's HTML instead of a 404, so Claude Code
never falls back — it tries to parse that HTML as the marketplace.json
object and fails.

Appending ".git" makes the URL unambiguously a git source, skipping
the JSON-fetch attempt. Verified against a real GitHub Enterprise
Server deployment: the command fails without the suffix exactly as
described above, and succeeds once it's added.

Model: Claude Sonnet 5
@riverma

riverma commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator Author

Does this patch break existing deployments, e.g. nasa-ammos.github.com/slim? Need to verify and prove it does not.

@riverma

riverma commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

The change only affects what command the website's "Claude Code" install tab displays to a user (adding .git to the end of the githubUrl string in getMarketplaceCommand()). It touches nothing in getRepositoryInfo() and doesn't change how nasa-ammos.github.io/slim is built or served.

Tested both forms directly against the live nasa-ammos/slim repo on github.com with Claude Code:

  • /plugin marketplace add nasa-ammos/slim (current displayed command, shorthand form) — succeeds
  • /plugin marketplace add https://github.com/nasa-ammos/slim.git (what the website will display after this PR) — also succeeds, identical result

Both add the marketplace cleanly and install/use its plugins without issue. The .git suffix is a no-op for github.com (which already falls back to git-clone correctly without it) — it's only load-bearing for GitHub Enterprise Server deployments behind SSO, where the unsuffixed form fails as described in the PR body. Since nasa-ammos.github.io/slim is github.com-hosted, it's unaffected either way.

This branch has not been deployed

No deployments
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