3.2.0 • Published 6 months ago

@webos-tools/cli v3.2.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
6 months ago

@webos-tools/cli

@webos-tools/cli is a Command-Line Interface (CLI) for webOS. It provides a collection of commands for creating, packaging, installing, and launching webOS apps or services in a command-line environment. With @webos-tools/cli, you can develop and test your app or service without using any IDE.

Announcement

We moved here from @webosose/ares-cli. In the future, we plan to develop and maintain a single webOS CLI here to support webOS.

We are releasing a single CLI that supports both webOS OSE and webOS TV through this released CLI (v3.0.0). You can switch to CLI for OSE or TV by installing one CLI and changing only the profile. For more details, see Profile Settings.

From the released CLI (v3.1.2) we integrated CLI commands for webOS APOLLO. You can switch to CLI for APOLLO by changing only the profile to apollo.

From the released CLI (v3.2.0) we integrated CLI commands for webOS SIGNAGE. You can switch to CLI for SIGNAGE by changing only the profile to signage.

Installation

!IMPORTANT If @webosose/ares-cli is installed globally, uninstall it before install globally @webos-tools/cli.

# Uninstall globally @webosose/ares-cli
$ npm uninstall -g @webosose/ares-cli
# Check whether uninstall @webosose/ares-cli
$ ares -V
ares: command not found

The @webos-tools/cli is installed using npm.

Note: @webos-tools/cli was tested on Node.js v14.15.1 and v16.20.2.

You can install @webos-tools/cli using the following command. We recommend installing it globally. For Linux and macOS, you might need the sudo command.

$ npm install -g @webos-tools/cli

Profile Settings

You can change the profile to tv, ose, apollo or signage. The default profile is tv (webOS TV).

$ ares-config --profile ose
profile and config data is changed to ose

You can change the profile at any time while using the CLI by using the above command.

Compatibility

The release cycle of @webos-tools/cli is independent from that of webOS OSE or webOS TV. The latest CLI is compatible with the latest webOS OSE and webOS TV. So, we recommend using the latest version of CLI.

If you want to use previous version of CLI, check the compatibility table for each platform.

Command List

The following table shows a list supported commands. For more details, refer to user guides in Documentation.

CommandDescriptionOSETVAPOLLOSIGNAGE
ares-configConfigures webOS CLI.vvvv
aresDisplays the help information for ares commands.vvvv
ares-generateCreates a webOS app or service from templates.vvvv
ares-packagePackages the app or services into a package file.vvvv
ares-setup-deviceManages the target devices.vvvv
ares-novacomCommand Line Tool to control the device.vv
ares-installInstalls the app or service on the target device.vvvv
ares-launchLaunches or terminates the app.vvvv
ares-inspectEnables Web Inspector or Node's Inspector for debugging web app or JS service.vvvv
ares-serverRuns the Web server for testing local app file.vvvv
ares-shellExecutes shell commands in the target device.vv
ares-pushPushes file(s) from a host machine to a target device.vv
ares-pullPulls file(s) from a target device to a host machine.vv
ares-deviceDisplays the device information.vvv
ares-logShows or saves logs of webOS apps and services.vv

Documentation

For ose profile:

For tv profile:

For signage profile:

Testing

You can test the @webos-tools/cli commands and their options to check their validity. Tests are performed by jasmine.

Prerequisites

  1. Turn on the webOS device.
  2. Check the IP address and SSH port number.
  3. (Only for webOS TV) Enable the developer mode. See App Testing with Developer Mode App

Performing the Test

The following table lists the default configurations for the test.

ParameterValue
profileose
deviceemulator
ip127.0.0.1
port6622
  • Test with default configurations.

    $ jasmine

    or

    $ jasmine --profile=ose --device=emulator --ip=127.0.0.1 --port=6622
  • Test with specific configurations. (The port number can be omitted when using port 22.)

    $ jasmine --profile=ose --device=webOSOSE --ip=192.168.0.12
  • Test with specific port configurations.

    $ jasmine --profile=ose --device=webOSOSE --ip=192.168.0.12 --port=24
  • Test ares-generate command.

    $ jasmine --profile=ose --device=webOSOSE --ip=192.168.0.12 --port=24 spec/jsSpec/ares-generate.js
  • Test the tv profile. passPhrase must be entered as an input parameter. See Turning Developer Mode on.

    $ jasmine --profile=tv --device=webOSTV --ip=192.168.0.12 --port=9922 --passPhrase=AB12CD

Contributing

You can contribute your source codes to our repository.

The step-by-step guide is as follows:

  1. Fork the @webos-tools/cli repository. Make sure that you fork the whole repository.
  2. Create a new branch from the develop branch.
  3. Implement the source codes and git push the changes to the new branch.
  4. Create a pull request. When you write the description for the pull request, make sure you follow Pull Request Description Guidelines.
  5. Submit the pull request to the owner.

Pull Request Description Guide

The following is an example of the pull reqeust description

Change ares-device-info to ares-device  

:Release Notes: 
Expand the scope of ares-device-info command by changing its name

:Detailed Notes:
For now, the scope of the ares-device-info command seems to narrow,
so it is hard to add other options to the command (such as capture)
- Rename ares-device-info.js to ares-device.js
- Add --system-info and --session-info options
- Update ares-device TC

:Testing Performed:
1. All unit test passed
2. ESLint done
3. Check the below commands
   $ ares-device
   $ ares-device --system-info
   $ ares-device --session-info

:Issues Addressed:
[ISSUE-1] Change ares-device-info to ares-device
  • Summary: Describe the summary of this pull request. Make sure you capitalize the first letter of the summary.
  • Release Notes: Describe what this pull request implements.
  • Detailed Notes: Describe the problems of this pull request and how to fix them.
  • Testing Performed: Describe tests you performed.
    • Unit test: Run CLI unit test via jasmine on the target device or emulator and write the result. All unit tests must be passed.
    • ESlint: Run eslint on @webos-tools/cli root directory and write the result. No warning or error would be allowed.
    • Detailed test steps for changes: Write commands that can test your changes. Make sure that maintainers can verify your changes using these steps.
  • Issues Addressed: Write issue numbers and those summary.

Copyright and License Information

Unless otherwise specified, all content, including all source code files and documentation files in this repository are:

Copyright (c) 2020-2024 LG Electronics, Inc.

All content, including all source code files and documentation files in this repository except otherwise noted are:

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0