CLI bulk commands
CLI bulk commands
The Box CLI bulk commands help you to automate repetitive tasks. By adding a --bulk-file-path
flag to your command, you are able to perform actions for many items at once.
For example, this command creates several folders using a CSV file specifying folder Name
, Description
, and the ParentId
of the parent folder:
box folders:create --bulk-file-path <PATH_TO_CSV>/folders-create.csv
CSV templates
Predefined CSV templates help you to structure the data you want to manage in bulk. Templates reside in the Bulk actions
directory, grouped into folders. The table below lists the currently available templates.
Templates | Description |
---|---|
box collaborations | Create, delete, and update collaborations. |
box files | Download, update, and upload files. |
box folders | Create and update folders, add metadata to folders. |
box groups | Create groups and add memberships. |
box metadata-templates | Create metadata templates and metadata cascade policies on folders. |
box shared-links | Delete shared links. |
box users | Create and update users, move one user's content to another user. |
box webhooks | Delete webhooks. |
Prerequisites
To use bulk commands, you will need a Box application with OAuth 2.0 authentication. If you don't have one, go to your Developer Console, and follow the guide Setup with OAuth 2.0.
Set up and use bulk commands
-
Clone the
boxcli
GitHub repository or download the files fromBulk actions
directory.git clone https://github.com/box/boxcli.git
-
Adjust the
.csv
template to your needs. For example, if you want to create several folders, you can use thefolders-create.csv
template as your starting point. -
Run the command.
box users:create --bulk-file-path <PATH_TO_CSV>/folders-create.csv