Major Revisions to the Box CLI Now Available in v2 Release.

Jonathan LeBlanc
Dec 21, 2018 · 2 min read
Image for post
Image for post
CLI V2 Fetch File Collaborations Example

We’re happy to announce a major update to the Box CLI with our recent v2 release. With this release we have included a number of major upgrades, bug fixes, and a new underlying open source CLI framework, oclif, that changes how the command structure functions.

To see this in practice, let’s look at a simple example to fetch the current user info in the old CLI version and the new version, to see how the command structure differs:

# Old Command Structure
box users get me
# New Command Structure
box users:get me

As you can see, colons are now employed to disambiguate commands from their arguments. This new architecture provides us with the ability to better structure (and differentiate) command and argument options, even when there are nested subcommands underneath a root command. The added benefit is that this allows us to shorten the length of the commands for performing actions.

Beyond the command structure changes and adoption of oclif, there are also a number of major upgrades:

  • Full API Parity: All available Box API endpoints are now available as commands and options within the CLI.
  • Recursive Folder Upload / Download: When uploading or downloading folders with a nested structures, that structure will now be preserved.
  • Custom API Calls: The new box request command will allow you to make calls to any Box API endpoint directly, allowing you to pass in arbitrary URLs and parameters.
  • Bulk Input / Output Updates: Every command can now accept its arguments and flags from a file input in either CSV or JSON format for bulk input. Bulk output commands no longer require the output to be written to disk, and can output JSON, CSV, or human-readable output directly to stdout or to any file.
  • User Friendly Prompts: Some commands (e.g. box configure:environments:select) can now be called without providing the necessary arguments, resulting in the command displaying a helpful prompt to allow you to select the argument value.
  • Command Autocomplete: Tab autocomplete can now be enabled easily through the CLI via the box autocomplete command.

Please see the v2 release notes for complete information on the changes to the Box CLI in this release.

For installer / getting started details, please see the developer documentation.

Happy CLI’ing!

Box Developer Blog

News and stories for working with the Box APIs

Jonathan LeBlanc

Written by

Emmy award winner, O'Reilly author, open source contributor, Senior Director of Developer Advocacy at Box.

Box Developer Blog

News and stories for working with the Box APIs

Jonathan LeBlanc

Written by

Emmy award winner, O'Reilly author, open source contributor, Senior Director of Developer Advocacy at Box.

Box Developer Blog

News and stories for working with the Box APIs

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store