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

Function runTokenGet

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

Source from the content-addressed store, hash-verified

540}
541
542async function runTokenGet(client: ArtifactClient, args: string[]): Promise<ArtifactsCLIResult> {
543 const parsed = parseFlags(args, {});
544 if ("error" in parsed) return argvError("token get", parsed.error);
545 const [repo, id] = parsed.positional;
546 if (repo === undefined) return argvError("token get", "missing <repo>");
547 if (id === undefined) return argvError("token get", "missing <id>");
548 if (parsed.positional.length > 2) {
549 return argvError("token get", `unexpected argument '${parsed.positional[2]}'`);
550 }
551 try {
552 return ok(json(await client.getToken(repo, id)));
553 } catch (cause) {
554 return mapError("token get", cause);
555 }
556}
557
558async function runTokenDelete(client: ArtifactClient, args: string[]): Promise<ArtifactsCLIResult> {
559 const parsed = parseFlags(args, {});

Callers 1

runTokenFunction · 0.85

Calls 6

argvErrorFunction · 0.85
okFunction · 0.85
jsonFunction · 0.85
mapErrorFunction · 0.85
parseFlagsFunction · 0.70
getTokenMethod · 0.65

Tested by

no test coverage detected