MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / installFromGithub

Function installFromGithub

src/skills/installer.ts:79–94  ·  view source on GitHub ↗
(spec: string, originalSource: string, opts: { force?: boolean })

Source from the content-addressed store, hash-verified

77}
78
79async function installFromGithub(spec: string, originalSource: string, opts: { force?: boolean }): Promise<InstallResult> {
80 // spec is like "user/repo" or "user/repo@ref"
81 const [repoPart, ref] = spec.split('@');
82 if (!repoPart || !/^[^/]+\/[^/]+$/.test(repoPart)) {
83 throw new Error(`Bad gh: spec "${spec}". Expected user/repo[@ref].`);
84 }
85 const tmp = await mkdtempIn(os.tmpdir(), 'qodex-skill-gh-');
86 const url = `https://github.com/${repoPart}.git`;
87 const args = ['clone', '--depth', '1', url, tmp];
88 if (ref) {
89 args.splice(2, 0, '--branch', ref);
90 }
91 runOrThrow('git', args, `clone ${url}`);
92 const root = await findSkillRoot(tmp);
93 return copyInto(root, originalSource, opts);
94}
95
96async function installFromNpm(spec: string, originalSource: string, opts: { force?: boolean }): Promise<InstallResult> {
97 const tmp = await mkdtempIn(os.tmpdir(), 'qodex-skill-npm-');

Callers 1

installSkillFunction · 0.85

Calls 4

mkdtempInFunction · 0.85
runOrThrowFunction · 0.85
findSkillRootFunction · 0.85
copyIntoFunction · 0.85

Tested by

no test coverage detected