MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / installFromGitHub

Function installFromGitHub

source code/utils/plugins/pluginLoader.ts:664–680  ·  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

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