CLI

C-L-What?

The MobileCaddy Command Line Interface is our utility package to help you quickly get started with a new project and aid your workflow.

Install

The mobilecaddy-cli can be installed through using NPM with this command; Note: you might need to use sudo if you’re on a Mac or Linux environment. The package only needs to be installed once, regardless of how many projects you build.

Usage

Creating a new project

A new MobileCaddy project, all ready for you to build a robust offline Salesforce mobile application, can be set up with just one command. The project can be based on one of several pre-defined templates of your own git repo.

The command will download the defined template project into the directory appName and will install all the dependencies needed for your app to run locally and be ready to be deployed to SFDC.

Command

Arguments

<template | git-zip-repo> : This is either the name of the template to use (see mobilecaddy templates command) or the URL of a git repositories downloadable git repo.

<appName> : The name you want to call your app.

--sudo : optional flag needed if you normally have to run npm commands as root.

 


 

Listing Templates

List the name and descriptions of MobileCaddy templates

Command

 


 

Starting your application

Starts your app up in a local web server and starts watch processes on the development files to aid your workflow. Options can be supplied to this command to either run against local data or against Salesforce.com.

The watch processes will perform JavaScript hinting and SCSS compilation (with live reload).

Command

Options

--scrub=true|full : --scrub=true will clear all local data apart from authentication information. --scrub=full will clear all data including SFDC oAuth info, so you will need to re-authenticate.

--local : Causes the app to run against the local mock data. This mock data can be found in the /mock directory.

--rec : When running against SFDC this option can be included to record the SFDC response to the app queries. This is useful if the platform config has been updated (e.g. a new field has been added to a table) and you would like to be able to use this data when running against the local mock files. When this is used the existing mock files are backed-up first. Only the results to the first of each call are recorded.

 


 

Help

View usage information

Command

 


 

Version Information

View version information. This displays the version of the mobilecaddy-cli you are currently using. It also displays the version information of the current project (taken from the package.json) in your current working directory.

Command