CLI Installation

Follow the procedure below to install CLI.

Important

If you have installed webOS OSE CLI (@webosose/ares-cli) with npm, you first need to remove it using the following command before installing webOS TV CLI.

npm uninstall -g @webosose/ares-cli

Step 1. Download CLI

Download the CLI (V1.12.3) corresponding to your OS and upzip it.

Linux 64-bit

Windows 64-bit

macOS 64-bit

Step 2. Check the environment variable

Check the LG_WEBOS_TV_SDK_HOME variable using theecho command.

Windows

echo %LG_WEBOS_TV_SDK_HOME%

Linux or macOS

echo $LG_WEBOS_TV_SDK_HOME

If environment variable LG_WEBOS_TV_SDK_HOMEalready exists, its path will be output.

Step 3. Configure the environment variables

Configure the environment variables. If environment variable LG_WEBOS_TV_SDK_HOMEalready exists, you can skip the configuration and will just replace the existing CLIdirectory with the new one.

Windows

  • If environment variable LG_WEBOS_TV_SDK_HOME already exists,
    1. Remove the existing CLI directory in the path output in Step 2.
    2. Place the new CLI directory, unzipped in Step 1, in the path output in Step 2.
  • If environment variable LG_WEBOS_TV_SDK_HOME does not exist,
    1. Create webOS_TV_SDK directory in the desired path.
    2. Place the CLI directory, unzipped in Step 1, under the webOS_TV_SDK directory.
    3. Configure the environment variables as in the following. Replace "YOUR_PATH" with the path you created the webOS_TV_SDK directory.
      // Setting the LG_WEBOS_TV_SDK_HOME variable to the parent directory of CLI
      > setx /m LG_WEBOS_TV_SDK_HOME "C:\YOUR_PATH\webOS_TV_SDK"
       
      // Setting the WEBOS_CLI_TV variable to the bin directory of CLI
      > setx /m WEBOS_CLI_TV "%LG_WEBOS_TV_SDK_HOME%\CLI\bin"
       
      // Adding the bin directory of CLI to the PATH variable
      > setx /m PATH "%PATH%;%WEBOS_CLI_TV%"
    4. Restart the command window or your PC to make the changes take effect.

Linux or macOS

  • If environment variable LG_WEBOS_TV_SDK_HOME already exists,
    1. Remove the existing CLI directory in the path output in Step 2.
    2. Place the new CLI directory, unzipped in Step 1, in the path output in Step 2.
  • If environment variable LG_WEBOS_TV_SDK_HOME does not exist,
    1. Create webOS_TV_SDK directory in the desired path.
    2. Place the CLI directory, unzipped in Step 1, under thewebOS_TV_SDK directory.
    3. Configure the environment variables as in the following. Replace "YOUR_PATH" with the path you created the webOS_TV_SDK directory.

      • For Linux, add the following at /etc/profile.
      • For macOS, add the following at /etc/profile if bash is the default shell (mojave (10.14) or lower) or at /etc/zprofile if zsh is the default shell (catalina (10.15) or higher).
      # Setting the LG_WEBOS_TV_SDK_HOME variable to the parent directory of CLI
      export LG_WEBOS_TV_SDK_HOME="/YOUR_PATH/webOS_TV_SDK"
       
      if [ -d "$LG_WEBOS_TV_SDK_HOME/CLI/bin" ]; then
        # Setting the WEBOS_CLI_TV variable to the bin directory of CLI
        export WEBOS_CLI_TV="$LG_WEBOS_TV_SDK_HOME/CLI/bin"
        # Adding the bin directory of CLI to the PATH variable
        export PATH="$PATH:$WEBOS_CLI_TV"
      fi

    4. Execute one of the following commands or restart the shell to make the changes take effect.
      $ source /etc/profile
      // or
      $ source /etc/zprofile
      Note

      To use webOS TV Emulator or webOS TV VS Code Extension, restart the PC.

Step 4. Verify the installation

Verify the installation by executing the ares –V command. If the installation is successful, you will see the version of webOS TV CLI as a result.

$ ares -V
webOS TV CLI Version: 1.12.0-j41-k

Example
The following is an example of environment variable LG_WEBOS_TV_SDK_HOME and file tree on Linux.

$ echo $LG_WEBOS_TV_SDK_HOME
/home/user/tool/webOS_TV_SDK
/home/user/tool/
├── webOS_TV_SDK
│   ├── CLI
│   │   ├── bin
│   │   └── ...
│   ├── Simulator
│   │   ├── webOS_TV_22_Simulator_1.0.0
│   │   │   ├── webOS_TV_22_Simulator_1.0.0.appimage
│   │   │   └── ...

No Headings