cb-cli export - Brings a ClearBlade platform System to the local development environment


cb-cli export 


Once you have run the init command, one next step is to cd into the newly created repo and run cb-cli export (or cb-cli pull – see below). This will “download” all useful clearblade objects into the repo – it completely populates the repo/directory structure shown above. The options specific to the export command are:

  • url
    The full url of the ClearBlade platform eg: https://platform.clearblade.com

  • system-key
    The system key for the system being brought local

  • messaging-url
    The messaging url for the system being brought local

  • email
    The email address of the developer working on the system (you)

  • cleanup
    Clears all directories prior to performing the export.

  • exportrows
    This not only exports the collection objects, but also export all “rows” (or items) in each collection. Be very careful when using this option as it may be unfeasable to export very large collections.

  • exportusers
    This exports the data (minus passwords) from the system’s users table. If not present on the command line, only the users table schema is exported.

  • exportitemid
    When exporting data collections, this option indicates that the item_id column should also be exported with each row.

  • sort-collections
    This option, when specified, will sort the rows of an exported data collection by item_id. This is useful when using a version control system and you wish to view the differences between two versions of a data collection.

  • data-page-size
    When exporting the rows of a data collection and there are a large number of rows (> 100k), it is adviseable to increase the number of rows constituting a page. This will improve the performance of the export by decreasing the number of queries against the database.

Once completed, all of the services, collections, timers, triggers, etc will reside in current repo. Meta data for all objects is in pretty-printed json format. In addition, the actual code for services and libraries is in javascript (.js) format.


You can shortcut the cb-cli init/cb-cli export steps by just calling cb-cli export outside of a repo. This will do a combination of init and export. You can either provide the init options on the command line or you will be prompted for them. This is a common way to begin working on a system locally.


cb-cli export

cb-cli export -exportrows -exportusers