Dynamics Mobile CLI
Command line tool for developers
Overview
Dynamics Mobile CLI is a command line tool installed together with the Dynamics Mobile NPM module.
The tool shall be used by developers during they daily activities as well in CI/CD scenarios.
Command list
The Dynamics Mobile CLI provides a set of command line commands to help the developer to initialize new project, attach apps to application area in Dynamics Mobile Platform , etc.
Following list of the supported commands
Command | Description |
initializes new application repository, e.g. this is the way to start a new project | |
print outs the list of the supported commands with short description | |
profile | local profile management |
upload test data to the current application area | |
print outs summary for the current repository | |
"de-attaches" the environment from the application area | |
similar to init, but overrides only the dynamics mobile sdk files | |
executes livelink query and print outs the result in the terminal |
Commands guide
init
Do not execute the init command over existing repository ( e.g. existing app) as the app initialization process may override files
create new mobile application project
create new backend app
help
The help command print outs the list of the supported commands in the command window
profile
The profile command allows management of the local profile.
Dynamics Mobile developers need to have an account on the Dynamics Mobile platform in order to be able to create apps. The development tools ( like Dynamics Mobile SDK and Dynamics Mobile CLI ) authenticate against the Dynamics Mobile Platform on behalf of the developer by using API key.
The profile command allows the developer to locally create one or more profiles where every profile contains application area and api key and then quickly switch between them from the command line allowing the developer to easily work with multiple accounts and application areas.
The profile command takes --o parameter which determines the operation which shall be performed over the profile[s].
Creating new local profile You can create new profile locally by executing the following command:
Login to already created profile You may activate existing profile by executing this command:
The effect of the login command is global, e.g. per machine user. This means that once the login command is executed, all subsequent CLI commands from this machine/user will be executed against this application area, no matter what is the current folder. Use dms info command to check the current application area.
Delete existing profile You may delete locally stored profile by executing the following command: NOTE: this command will only delete the stored information from your local machine. It will not affect the actual application area or other machines.
Getting the list of the existing local profiles This will show a list of already created profiles on your machine.
You can NOT an build and run your app via npm run build or via Visual Studio Code F5/Debug command unless the dms profile --o login command is executed.
data
The data command, uploads test data to Dynamics Mobile platform. It requires the current environment to be attached to Dynamics Mobile Platform via the login command.
Using --m prod switch will publish the data to the production environment.
For mobile apps, this will "override" the mobile database for the given user.
For backend apps, this will "override" the entire production database, so use with caution.
info
The info command prints out the following information on the screen:
Current global application area ( requires dms login command to be executed)
Current global username
Current application code ( if the current folder is valid application repository)
Current application version ( from package.json)
Current application type - backend (b) or mobile (m)
logout
"De-attaches" the current environment from the application area. The command wipes out the current authentication info, which will makes some of the CLI commands non-usable unless the dms login command is executed again.
refresh
The refresh command "refreshes" the current application repository with the latest sdk files. It is designed to be used after the latest version of the dynamics mobile sdk was installed.
Make sure you have commited all changes in your local application repository before executing the refresh command to avoid any data loss.
livelink
The command executes livelink request and prints or saves the result in a file. It allows the developer to craft and play with ODATA queries right into the terminal and export data to CSV, JSON and SyncPacket (XML) files.
All command livelink queries are executed against the current application area with the user credentials acquired with the dms login command beforehand.
All command livelink queries are also executed against the sandbox storage of the current user ( the sandbox storage is a temporary storage separated for each user). The sandbox mode can be overridden with switch --mode prod
All command livelink queries are executed against the current application - the application code written in package.json in the dms.appCode property. This can be overridden with the --app XXX switch, where XXX must be another valid application code , which exists in the current application area.
All command livelink queries are executed against entity, which is defined in the current application - e.g. there must be a corresponding entity bo.json file in ./src/Business Objects or ./ext/Business Objects/ folders
Last updated