MCPcopy Create free account
hub / github.com/bitwarden/clients / archiveCommand

Method archiveCommand

apps/cli/src/vault.program.ts:447–474  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

445 }
446
447 private archiveCommand(): Command {
448 const archiveObjects = ["item"];
449 return new Command("archive")
450 .argument("<object>", "Valid objects are: " + archiveObjects.join(", "))
451 .argument("<id>", "Object's globally unique `id`.")
452 .description("Archive an object from the vault.")
453 .on("--help", () => {
454 writeLn("\n Examples:");
455 writeLn("");
456 writeLn(" bw archive item 7063feab-4b10-472e-b64c-785e2b870b92");
457 writeLn("", true);
458 })
459 .action(async (object, id) => {
460 if (!this.validateObject(object, archiveObjects)) {
461 return;
462 }
463
464 await this.exitIfLocked();
465 const command = new ArchiveCommand(
466 this.serviceContainer.cipherService,
467 this.serviceContainer.accountService,
468 this.serviceContainer.cipherArchiveService,
469 this.serviceContainer.billingAccountProfileStateService,
470 );
471 const response = await command.run(object, id);
472 this.processResponse(response);
473 });
474 }
475
476 private restoreCommand(): Command {
477 const restoreObjects = ["item"];

Callers 1

registerMethod · 0.95

Calls 5

validateObjectMethod · 0.95
runMethod · 0.95
actionMethod · 0.80
descriptionMethod · 0.45
processResponseMethod · 0.45

Tested by

no test coverage detected