MCPcopy
hub / github.com/Fission-AI/OpenSpec / setup

Method setup

src/commands/store.ts:517–541  ·  view source on GitHub ↗
(id: string | undefined, options: StoreSetupOptions = {})

Source from the content-addressed store, hash-verified

515
516class StoreCommand {
517 async setup(id: string | undefined, options: StoreSetupOptions = {}): Promise<void> {
518 try {
519 const setupInput = await resolveSetupInput(id, options);
520 const prepared = await prepareSetupInput(setupInput, options);
521 const initGit = resolveSetupGitEnabled(prepared, options.initGit);
522 if (!options.json && isInteractive()) {
523 await confirmSetup(prepared, initGit);
524 }
525 const result = await setupPreparedStore(prepared, { initGit });
526 const payload = toMutationOutput(result);
527
528 if (options.json) {
529 printJson(payload);
530 return;
531 }
532
533 printMutationHuman('Store ready', payload, result.remotes);
534 } catch (error) {
535 this.handleFailure(
536 options.json,
537 { store: null, registry: null, git: null, created_files: [], status: [] },
538 error
539 );
540 }
541 }
542
543 async register(inputPath: string | undefined, options: StoreRegisterOptions = {}): Promise<void> {
544 try {

Callers 1

registerStoreCommandFunction · 0.95

Calls 10

handleFailureMethod · 0.95
resolveSetupInputFunction · 0.85
prepareSetupInputFunction · 0.85
resolveSetupGitEnabledFunction · 0.85
isInteractiveFunction · 0.85
confirmSetupFunction · 0.85
setupPreparedStoreFunction · 0.85
toMutationOutputFunction · 0.85
printMutationHumanFunction · 0.85
printJsonFunction · 0.70

Tested by

no test coverage detected