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

Method listCommand

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

Source from the content-addressed store, hash-verified

54 }
55
56 private listCommand(): Command {
57 const listObjects = [
58 "items",
59 "folders",
60 "collections",
61 "org-collections",
62 "org-members",
63 "organizations",
64 ];
65
66 const command = new Command("list")
67 .argument("<object>", "Valid objects are: " + listObjects.join(", "))
68 .description("List an array of objects from the vault.")
69 .option("--search <search>", "Perform a search on the listed objects.")
70 .option("--url <url>", "Filter items of type login with a url-match search.")
71 .option("--folderid <folderid>", "Filter items by folder id.")
72 .option("--collectionid <collectionid>", "Filter items by collection id.")
73 .option(
74 "--organizationid <organizationid>",
75 "Filter items or collections by organization id.",
76 )
77 .option("--trash", "Filter items that are deleted and in the trash.")
78 .on("--help", () => {
79 writeLn("\n Notes:");
80 writeLn("");
81 writeLn(" Combining search with a filter performs a logical AND operation.");
82 writeLn("");
83 writeLn(" Combining multiple filters performs a logical OR operation.");
84 writeLn("");
85 writeLn(" Examples:");
86 writeLn("");
87 writeLn(" bw list items");
88 writeLn(" bw list items --folderid 60556c31-e649-4b5d-8daf-fc1c391a1bf2");
89 writeLn(
90 " bw list items --search google --folderid 60556c31-e649-4b5d-8daf-fc1c391a1bf2",
91 );
92 writeLn(" bw list items --url https://google.com");
93 writeLn(" bw list items --folderid null");
94 writeLn(" bw list items --organizationid notnull");
95 writeLn(
96 " bw list items --folderid 60556c31-e649-4b5d-8daf-fc1c391a1bf2 --organizationid notnull",
97 );
98 writeLn(" bw list items --trash");
99 writeLn(" bw list items --archived");
100 writeLn(" bw list folders --search email");
101 writeLn(" bw list org-members --organizationid 60556c31-e649-4b5d-8daf-fc1c391a1bf2");
102 writeLn("", true);
103 })
104 .action(async (object, cmd) => {
105 if (!this.validateObject(object, listObjects)) {
106 return;
107 }
108
109 await this.exitIfLocked();
110 const command = new ListCommand(
111 this.serviceContainer.cipherService,
112 this.serviceContainer.folderService,
113 this.serviceContainer.collectionService,

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