MCPcopy Create free account
hub / github.com/cloudflare/computer / runRepo

Function runRepo

packages/computer/src/artifacts/cli.ts:318–343  ·  view source on GitHub ↗
(client: ArtifactClient, args: string[])

Source from the content-addressed store, hash-verified

316// ---------------------------------------------------------------
317
318async function runRepo(client: ArtifactClient, args: string[]): Promise<ArtifactsCLIResult> {
319 if (args.length === 0) {
320 return { stdout: repoHelp(), stderr: "", exitCode: 1 };
321 }
322 const [sub, ...rest] = args;
323 switch (sub) {
324 case "help":
325 case "--help":
326 case "-h":
327 return ok(repoHelp());
328 case "create":
329 return await runRepoCreate(client, rest);
330 case "get":
331 return await runRepoGet(client, rest);
332 case "list":
333 return await runRepoList(client, rest);
334 case "delete":
335 return await runRepoDelete(client, rest);
336 case "import":
337 return await runRepoImport(client, rest);
338 default:
339 return fail(
340 `artifacts repo: '${sub}' is not a repo subcommand. See 'artifacts repo --help'.`,
341 );
342 }
343}
344
345async function runRepoCreate(client: ArtifactClient, args: string[]): Promise<ArtifactsCLIResult> {
346 const parsed = parseFlags(args, {

Callers 1

runArtifactsCLIFunction · 0.85

Calls 8

repoHelpFunction · 0.85
okFunction · 0.85
runRepoCreateFunction · 0.85
runRepoGetFunction · 0.85
runRepoListFunction · 0.85
runRepoDeleteFunction · 0.85
runRepoImportFunction · 0.85
failFunction · 0.70

Tested by

no test coverage detected