Giter Site home page Giter Site logo

webosose / ares-cli Goto Github PK

View Code? Open in Web Editor NEW
35.0 9.0 16.0 717 KB

ares-cli is a command-line interface(CLI) for webOS

License: Apache License 2.0

JavaScript 99.14% HTML 0.64% QML 0.22%
cli lg webos webosose webos-ose webos-application webos-service

ares-cli's Introduction

ares-cli

Warning

We moved to @webos-tools/cli. In the future, we plan to develop and maintain a single webOS CLI to support multi webOS in @webos-tools/cli. This repository has been deprecated since March 4, 2024.

ares-cli is a command-line interface (CLI) for webOS. It provides a collection of commands used for creating, packaging, installing, and launching apps or services in the command line environment. ares-cli lets you develop and test apps or services without using any IDE.

Installation

To install ares-cli, use npm. It is recommended to install ares-cli globally. For Linux and macOS, you might need the sudo command.

$ npm install -g @webosose/ares-cli

Note: Node version 10.24.1 to 14.15.1 are recommended.

Compatibility

Our release cycle is independent of webOS OSE and Auto. We recommend using the latest CLI. The latest CLI is compatible with the latest webOS OSE and Auto"

For information about the CLI previous version and compatible with platform, see the CLI Release Notes.

Command List

The list of ares-cli commands is as follows:

  • ares-generate: Creates a webOS app or service from templates.
  • ares-package: Packages the app or services into a package file.
  • ares-setup-device: Manages the target devices.
  • ares-install: Installs the app or service on the target device.
  • ares-launch: Launches or terminates the app.
  • ares-inspect: Enables Web Inspector or Node's Inspector for debugging web app or JS service.
  • ares-server: Runs the Web server for testing local app file.
  • ares-shell: Executes shell commands in the target device.
  • ares-push: Pushes file(s) from a host machine to a target device.
  • ares-pull: Pulls file(s) from a target device to a host machine.
  • ares-device: Displays the device information.
  • ares-log: Shows or saves logs of webOS apps and services.

Documentations

  • For more details about how to use ares-cli, see the webOS OSE CLI User Guide.
  • For step-by-step guides for developing apps or services, see the tutorials.
    • Developing External Web Apps
    • Developing External JS Services
    • Developing External QML Apps
    • Developing External Native Apps
    • Developing External Native Services

Test Commands

You can test the ares-cli commands and their options to check their validity. The test is performed by jasmine or npm test.

Before You Begin

  1. Turn on the webOS device.
  2. Check the IP address and SSH port number.
  3. Enable the developer mode.
    • webOS OSE: Already enabled by default.
    • webOS Auto: Enable it in the Settings app.

The following key-value pairs are the default configurations for the test.

Key Value
device emulator
ip 127.0.0.1
port 6622

Test Usages

  • Test with default configurations.

    $ jasmine

    or

    $ jasmine device=emulator, ip=127.0.0.1, port=6622
  • Test with specific configurations. (It can be omitted when using port 22.)

    $ jasmine --device=webOS --ip=192.168.0.12
  • Test with specific port configurations.

    $ jasmine --device=webOS --ip=192.168.0.12 --port=24
  • Test ares-generate command.

    $ jasmine --device=webOS --ip=192.168.0.12 --port=24 spec/jsSpec/ares-generate.js
  • Test using npm command npm test instead of jasmine.

    $ npm test --device=webOS --ip=192.168.0.12 --port=24

Contributing

The step-by-step guide to contribute is as follows:

  1. Fork: Fork source from ares-cli repository.
  2. Create a new branch: Create a branch from develop branch.
  3. Implement: Implement the source codes and git push the changes to the new branch.
  4. Create a pull request: Create a pull request. When you write a commit message, make sure you follow Commit Message Guidelines.
  5. Submit the pull request to the owner.

Commit Message Guidelines

The following is an example of the commit message.

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 a summary of the pull request. Make sure you capitalize the first letter of the summary.
  • Release Notes: Describe what this commit implements.
  • Detailed Notes: Describe the problems of this commit and how to fix them.
  • Testing Performed: Describe detailed descriptions of the testing 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 ares-cli root directory and write the result. No warning/error would be allowed.
    • Detail test steps with CLI commands : Write the commands to verify your changes. Be sure that the maintainers can check the changes by running that commands.
  • Issues Addressed: Write an issue number and its 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-2023 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

ares-cli's People

Contributors

kclod-kim avatar mariotaku avatar ssuminahn avatar youngeunkim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ares-cli's Issues

Bundle assets into the .ipk

I'm trying to create an ipk file.
my appinfo.json looks like this:

{
  "id": "test",
  "version": "1.0.0",
  "vendor": "My Company",
  "type": "web",
  "main": "index.html",
  "title": "Test",
  "icon": "icon.png",
  "largeIcon": "largeIcon.png"
}

In the same folder, I have an index.html which looks like this:

<!DOCTYPE html>
<html>
  <head>
    <title>Test app</title>
  </head>
  <body>
    <video autoplay muted>
      <source
        src="./video.mp4"
        type="video/mp4"
        width="100vw"
        height="100vh"
      />
    </video>
  </body>
</html>

as you can see I have a video.mp4 file sitting next to the index.html.

I realised that creating a package using ares-package ./test creates the .ipk file but it doesn't bundle the video file within the package.

I was wondering if there is a way to bundle assets along with the index.html in an LG package?

Cannot install application

Hey,

Recently webos informed me I need to update my developer application to continue using it - and I did that. After TV restart I recognized my custom apps are not there anymore. When I try to install them once again I'm receiving:


PS C:\Users\konra>  ares-install valid-path-to-file -d tv
[Info] Set target device : tv
ares-install ERR! [ssh exec failure]: Command '/bin/rm -rf /media/developer/temp && /bin/mkdir -p /media/developer/temp' exited with code=1
ares-install ERR! [ssh exec failure]: (Original Message: rm: can't remove '/media/developer/temp': Permission denied)

Before the update I was using this command all the time.

ares-device -i fails on webOS3.5

ares-device info device#tvSystemInfo#_getSystemInfo()
ares-device verb luna#send() calling: -n 1 luna://com.webos.service.tv.systemproperty//getSystemInfo '{"keys":["modelName","sdkVersion","firmwareVersion","boardType","otaId"],"subscribe":false}'
ares-device info novacom#Session()#run() cmd:/usr/bin/luna-send-pub -n 1 luna://com.webos.service.tv.systemproperty//getSystemInfo '{"keys":["modelName","sdkVersion","firmwareVersion","boardType","otaId"],"subscribe":false}', opt:{}
ares-device verb novacom#Session()#run() resuming input
ares-device verb novacom#Session()#run() on data (stdout)
ares-device verb luna#send() response: {
ares-device verb luna#send()   returnValue: false,
ares-device verb luna#send()   modelName: '32LJ6100-UA',
ares-device verb luna#send()   sdkVersion: '3.9.0',
ares-device verb luna#send()   firmwareVersion: '00.00.00',
ares-device verb luna#send()   boardType: 'M2R_ATSC_KR',
ares-device verb luna#send()   errorCode: 'ERROR_06',
ares-device verb luna#send()   errorText: 'Invalid argument'
ares-device verb luna#send() }
ares-device info finish()
ares-device ERR! [com.webos.service.tv.systemproperty failure]: luna-send command failed <Invalid argument>

ares-device -i command filas on webOS TV 3.5 model.

Change output filename

I am trying to change the output of ares-package filename but it seems it doesn't work.

Looking as the help section, this should generate the file called foopkg_1.0.1.ipk:

ares-package APP_DIR -f -pn foopkg -pv 1.0.1

But i am keep getting the error: The specified path does not exist <foopkg>.
Am i doing something wrong?

My command is ares-package ./build -f -pn foopkg -pv 1.0.1.

ares-package on Windows does not have a way to set correct file mode to executable files

ares-package works almost flawlessly in Windows, but because Windows does not have executable bits in NTFS, they cannot be set before packaging.

I solved it for me by forcing every packaged file to use permissions mode 0777 by changing ares-cli/lib/package.js:1146:

            } else if (entry.props.type === "File") {
                // Add other user's readable permission to all files
                entry.props.mode = 511; // 0777
            }

ares-device -c capture.png failes with unknown method "captureCompositorOutput"

Running the following command on 2.3.1 while attempting to generate a screenshot:

ares-device -c screen.png -d device_name

Results in following error:

[Info] Set target device : device_name
ares-device ERR! [com.webos.surfacemanager failure]: luna-send command failed <Unknown method "captureCompositorOutput" for category "/">

Appreciate any help you can provide.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.