@brightsign/bsc

4.1.0 • Public • Published

Powered by Purple!

bsc - The BrightSign CLI

Node.js PNPM TypeScript License


The BrightSign CLI tool bsc is the command line interface for interacting with the Diagnostic Web Server (DWS).

This is the second version of bsc, with the deprecated code being found here. This code contains breaking changes, so update with caution.

Table of Contents

Install the CLI

It is recommended to install the CLI through a package manager. You can use either npm or pnpm:

# Using npm
npm install --global @brightsign/bsc

# Using pnpm
pnpm add -g @brightsign/bsc

Getting Started

Configure Credentials

Before using most commands, you need to configure your BrightSign credentials. You can do this in one of two ways:

  1. Run the configuration wizard:
bsc configure
  1. Set the following environment variables:
# Required
BRIGHTSIGN_CLIENT_ID=your_client_id
BRIGHTSIGN_CLIENT_SECRET=your_client_secret

# Optional - specify one of these as a default
BRIGHTSIGN_NETWORK_NAME=your_network_name
BRIGHTSIGN_NETWORK_ID=your_network_id

Note: You can obtain your BrightSign Client ID and Secret by creating an application at https://adminpanel.bsn.cloud/.

Filepath Naming Convention

Many commands require either a filePath or a source parameter to be passed in. When we refer to a file on the player, or any path locally (file or directory), this is filePath. When referring to a directory on the player, this is source or destination.

To upload a file, for example:

bsc files upload --ip 192.168.1.1 --username admin --password yourpassword --source ./path-to-your-file --destination sd/path-on-player

Note that the --destination option is optional, and without it the file will be uploaded to the root of the SD card. Also note that you can upload directories or files with --source.

Key Features

  • Player Management: List and retrieve BrightSign player information.
  • File Operations: Upload, download, delete, and list files.
  • Registry Management: Get, set, and delete registry entries.
  • System Information: Retrieve player information, including hardware details, network configuration, and system status.
  • Power Management: Reboot, reset, and control player power state.
  • Screenshot Capture: Take screenshots from connected players.

Requirements

  • Node.js 20.11.1 or later
  • Network connectivity to your BrightSign player

Contributing

We welcome contributions! Please see our CONTRIBUTING.md for guidelines on how to get started developing bsc.

License

MIT License - See LICENSE file for details.

Usage Examples

Connection Modes:

Almost all commands support both remote (BSN.Cloud) and local connection options:

  • Remote (BSN.Cloud): Use the player's serial number with --player <serial>. This just requires internet access.
  • Local: Use the player's IP address with --ip <address>, --username <name> (defaults to admin), and --password <password>. Local DWS must be enabled on the player for this to work.

Tip: If you are unsure which to use, remote is for cloud-managed devices and devices in a production environment, local is mostly for development work.

Here are some common commands and their expected outputs:

1. List all players in your network

bsc players list

Expected output:

+--------------+-------------------+-------------------+
| Serial       | Model             | Status            |
+--------------+-------------------+-------------------+
| UTF12481632  | XD234             | Online            |
| UTF12481633  | XT1144            | Offline           |
+--------------+-------------------+-------------------+

2. Get information about a specific player (remote)

bsc players get --player UTF12481632

Expected output:

{
  "serial": "UTF12481632",
  "model": "XD234",
  "firmware": "9.0.45",
  "ip": "192.168.1.1",
  ...
}

3. Get information about a specific player (local)

bsc players get --ip 192.168.1.1 --username admin --password abcdefg

Expected output:

{
  "serial": "UTF12481632",
  "model": "XD234",
  "firmware": "9.0.45",
  "ip": "192.168.1.1",
  ...
}

4. Upload a file to a player (local)

bsc files upload --ip 192.168.1.1 --username admin --password abcdefg --source ./video.mp4 --destination sd

Expected output:

Uploading ./video.mp4 to sd on 192.168.1.1...
Upload complete.

5. Take a screenshot from a player (local)

bsc players screenshot --ip 192.168.1.1 --username admin --password abcdefg --output-path ./screen.jpg

Expected output:

Screenshot saved to ./screen.jpg

Readme

Keywords

none

Package Sidebar

Install

npm i @brightsign/bsc

Weekly Downloads

55

Version

4.1.0

License

MIT

Unpacked Size

2.51 MB

Total Files

4

Last publish

Collaborators

  • jenkinsbs
  • bhastings
  • bshukla
  • rainbowjade
  • buildsatbrightsign
  • timdmorris
  • release-bs
  • gparris
  • harryniotis
  • release-bs-pe
  • kkennedy