Skip to main content

delete

The delete command deletes an object from your safe. delete only accepts an exact id for its argument.

bsafe delete (item|attachment|folder|org-collection) <id> [options]

By default, delete will "soft delete" an item (send it to the trash). You can permanently delete an item using the -p, --permanent option.

bsafe delete item 7063feab-4b10-472e-b64c-785e2b870b92 --permanent

To delete a Team-collection, you will also need to specify --teamid <teamid>. See Team IDs.

Warning

While items that are "soft deleted" using delete can be recovered using the restore command (restore), items that are deleted using delete -- permanent are completely removed and irrecoverable.

Accessing a Team from the CLI requires knowledge of the ID for the Team, as well as IDs for individual members and collections.

Retrieve this information directly from the CLI using bsafe list (list), for example:

bsafe list organizations
bsafe list org-members --organizationid 4016326f-98b6-42ff-b9fc-ac63014988f5
bsafe list org-collections --organizationid 4016326f-98b6-42ff-b9fc-ac63014988

You can bsafe list both collections and org-collections.

  • bsafe list collections will list all collections, regardless of the Team to which they belong.

  • bsafe list org-collections will list only collections that belong to the Team specified using --organizationid.

The list command retrieves an array of objects from your safe:

bsafe list (items|folders|collections|organizations|org-collections|org-members) [options]

Options for the list command are filters used to dictate what will be returned, including:

  • --url <url>

  • --folderid <folderid>

  • --collectionid <collectionid>

  • --organizationid <organizationid>

  • --trash

Any filter will accept null or notnull. Combining multiple filters in one command will perform a logical OR operation; for example, the following command returns items that are not in a folder or collection.

bsafe list items --folderid null --collectionid null

Additionally, you can search for specific objects using --search <search-term>. Combining filter and search in one command will perform a logical AND operation. For example, the following command searches for items with the string github in the specified folder:

bsafe list items --search github --folderid 9742101e-68b8-4a07-b5b1-9578b5f88e

The restore command restores a deleted object from your Trash. restore only accepts an exact id for its argument.

bsafe restore (item) <id> [options]

For example:

bsafe restore item 7063feab-4b10-472e-b64c-785e2b870b92