MCPcopy Index your code
hub / github.com/codeaashu/claude-code / installFromGitHub

Function installFromGitHub

src/utils/plugins/pluginLoader.ts:662–678  ·  view source on GitHub ↗

* Install a plugin from GitHub

(
  repo: string,
  targetPath: string,
  ref?: string,
  sha?: string,
)

Source from the content-addressed store, hash-verified

660 * Install a plugin from GitHub
661 */
662async function installFromGitHub(
663 repo: string,
664 targetPath: string,
665 ref?: string,
666 sha?: string,
667): Promise<void> {
668 if (!/^[a-zA-Z0-9-_.]+\/[a-zA-Z0-9-_.]+$/.test(repo)) {
669 throw new Error(
670 `Invalid GitHub repository format: ${repo}. Expected format: owner/repo`,
671 )
672 }
673 // Use HTTPS for CCR (no SSH keys), SSH for normal CLI
674 const gitUrl = isEnvTruthy(process.env.CLAUDE_CODE_REMOTE)
675 ? `https://github.com/${repo}.git`
676 : `git@github.com:${repo}.git`
677 return installFromGit(gitUrl, targetPath, ref, sha)
678}
679
680/**
681 * Resolve a git-subdir `url` field to a clonable git URL.

Callers 1

cachePluginFunction · 0.85

Calls 2

isEnvTruthyFunction · 0.85
installFromGitFunction · 0.85

Tested by

no test coverage detected