Introduction
The CLI (Command Line Interface) provides a collection of commands used for creating, packaging, installing, and launching web apps in the command line environment. The CLI allows you to develop and test your app without having to use a specific IDE.
CLI Features
With the CLI, you can install your app on a target device, such as the emulator or webOS TV. Besides, you can retrieve, run, terminate, and remove the apps installed on the target device. You can use the CLI during any of the following stages of the development process:
Commands
The following shows the commands you could use:
Commands |
Descriptions |
---|---|
ares |
Provides the help menu for using the ares commands |
Creates a web app from a template. |
|
Creates and analyses an app package file. |
|
Manages the target devices. |
|
Installs an app on the target device. |
|
Runs or terminates the web app. |
|
Runs the Web Inspector for web app debugging. |
|
Runs the Web server for testing local app files. |
|
Gets a private key from webOS TV for the Developer Mode app. |
|
Retrieves a device's system information and monitors the device's resource usage. |
|
ares-extend-dev | Extends the session time of the developer mode for the Developer Mode app. |
-
Open All
-
- ares-generate
-
Creates an app from a template.
The ares-generate command displays a list of available templates for a web app, JS service, and webOS config file (appinfo.json).
Usages
ares-generate [OPTION...] APP_DIR|SERVICE_DIR
ares-generate --list|-l
ares-generate --version
ares-generate --help|-h
Options
Option
Parameter
Description
-t, --template
TEMPLATE
Uses the specified template.
-p, --property
PROPERTY
Saves the application information that is entered.
-s, --servicename
SERVICE_NAME
Specifies the JS Service ID.
-f, --overwrite
None
Allows overwriting of existing files.
-l, --list
None
Lists templates of each template type.
-v
None
Displays the execution log.
-V, --version
None
Displays the version of the ares-generate command.
-h, --help
None
Displays the help of the ares-generate command
Parameters
Parameter
Description
APP_DIR
Specifies the app project directory. If the directory does not exist, the directory is created while executing the command.
SERVICE_DIR
Specifies the service directory. If the specified directory does not exist, the directory is created while executing the command.
PROPERTY
Specifies the app information. You should entere this parameter using JSON-type strings in the format of "Key=Value" or "{'key1':'value1', 'key2':'value2', ...}".
TEMPLATE
Specifies the template to use when creating a project.
SERVICE_NAME
The ID of the service you are creating. The service ID must be a sub-domain of the ID of the app to which the service belongs.
Examples
Here are some examples of CLI usage:
Listing the bootplate (web app templates)
ares-generate -l
basic Web App - (default) basic web app for webOS TV
hosted_webapp Web App - hosted web app for webOS TV
webappinfo Web App Info - appinfo.json for web app
js_service JS Service - js service for webOS TV
jsserviceinfo JS Service Info - services.json, package.json for JS service
packageinfo Package Info - packageinfo.json for webOS packageCreating a web app with the default template
ares-generate sampleApp
? app id com.example.sampleapp
? title Sample App
? version 0.0.1
Generating basic in C:\webOS_TV_SDK\CLI\sampleApp
SuccessCreating a web app with custom App ID in ./sampleApp directory
ares-generate -p "id=com.example.sampleapp" sampleApp
Generating basic in C:\webOS_TV_SDK\CLI\sampleApp
SuccessCreating a web app with the hosted web app template in ./sampleApp directory
ares-generate -t hosted_webapp sampleApp
? app id com.example.hostedapp
? title Hosted App
? version 0.0.1
? url http://webostv.hostedapp.lge.com
Generating hosted_webapp in C:\webOS_TV_SDK\CLI\sampleApp
SuccessCreating a JS Service with custom Service ID in ./sampleService directory
ares-generate -t js_service -s com.example.sampleapp.sampleservice sampleService
The service ID must be a sub-domain of the ID of the app to which the service belongs.
Creating a web app in the ./sampleApp and setting properties with JSON string
ares-generate -p "{'id':'com.example.sampleapp', 'version':'0.0.1', 'icon':'icon.png', 'type':'web', 'title':'Sample App', 'main':'index'}" sampleApp