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

Method listCommand

apps/cli/src/vault.program.ts:77–179  ·  view source on GitHub ↗
(useSharedFoldersTerm: boolean)

Source from the content-addressed store, hash-verified

75 }
76
77 private listCommand(useSharedFoldersTerm: boolean): Command {
78 const listObjects = [
79 "items",
80 "folders",
81 "my-folders",
82 "collections",
83 "shared-folders",
84 "org-collections",
85 "org-shared-folders",
86 "org-members",
87 "organizations",
88 ];
89 const shownObjects = this.visibleObjects(listObjects, useSharedFoldersTerm);
90
91 const command = new Command("list")
92 .argument("<object>", "Valid objects are: " + shownObjects.join(", "))
93 .description("List an array of objects from the vault.")
94 .option("--search <search>", "Perform a search on the listed objects.")
95 .option("--url <url>", "Filter items of type login with a url-match search.")
96 .option(
97 "--folderid <folderid>",
98 `Filter items by ${useSharedFoldersTerm ? "my folder" : "folder"} id.`,
99 )
100 .addOption(
101 new Option("--collectionid <collectionid>", "Filter items by collection id.").hideHelp(
102 useSharedFoldersTerm,
103 ),
104 )
105 .addOption(
106 new Option(
107 "--sharedfolderid <sharedfolderid>",
108 "Filter items by shared folder id.",
109 ).hideHelp(!useSharedFoldersTerm),
110 )
111 .option(
112 "--organizationid <organizationid>",
113 `Filter items or ${useSharedFoldersTerm ? "shared folders" : "collections"} by organization id.`,
114 )
115 .option("--trash", "Filter items that are deleted and in the trash.")
116 .on("--help", () => {
117 writeLn("\n Notes:");
118 writeLn("");
119 writeLn(" Combining search with a filter performs a logical AND operation.");
120 writeLn("");
121 writeLn(" Combining multiple filters performs a logical OR operation.");
122 writeLn("");
123 writeLn(" Examples:");
124 writeLn("");
125 writeLn(" bw list items");
126 writeLn(" bw list items --folderid 60556c31-e649-4b5d-8daf-fc1c391a1bf2");
127 writeLn(
128 " bw list items --search google --folderid 60556c31-e649-4b5d-8daf-fc1c391a1bf2",
129 );
130 writeLn(" bw list items --url https://google.com");
131 writeLn(" bw list items --folderid null");
132 writeLn(" bw list items --organizationid notnull");
133 writeLn(
134 " bw list items --folderid 60556c31-e649-4b5d-8daf-fc1c391a1bf2 --organizationid notnull",

Callers 1

registerMethod · 0.95

Calls 6

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

Tested by

no test coverage detected