Installation
npm install -g usp-cli
Cloning
Clone repository, then inside the folder:
npm install
npm link
You can now use usp in your terminal.
After installing make sure to run usp config
once to properly configure the connection settings.
CLI
USAGE
$ usp [COMMAND]
Commands:
- help [command...] Provides help for a given command.
- version/-v/--version Shows current cli version
- exit Exits application.
- config [options] Change connection config
- connect Connect to device
- disconnect Disconnect from device
- get [options] <paths...> Get value at path
- set <value...> Set value at path
- operate [value...] Execute operation at path
- add [value...] Add object to path
- del Delete object from path
- sniffer [pattern] Puts cli in mode that displays all incoming messages with pattern matching (default pattern .*)
- subscribe Subscribe to type of event at given path
config
Change connection config
USAGE
$ usp config
OPTIONS -d, --default Restore default configuration -p, --print Print current config
get
Get value at path
USAGE
$ usp get PATH
OPTIONS -r, --resolve=resolve resolve references in result
EXAMPLES
$ usp get Device.WiFi. $ usp get Device.WiFi.Radio.1. Device.WiFi.Radio.2.
set
Set value at path
USAGE
$ usp set PATH VALUE
EXAMPLES
$ usp set Device.WiFi.Radio.1.Alias cpe-1 $ usp set Device.WiFi.Radio.1. { Alias: 'cpe-1' }
operate
Run given operation
USAGE
$ usp operate PATH [VALUES]
EXAMPLE
$ usp operate Device.SelfTestDiagnostics() $ usp operate Device.IP.Diagnostics.IPPing() { Host: 'iopsys.eu' }
add
Add object to path
USAGE $ usp add PATH [OBJECT]
EXAMPLES $ usp add Device.NAT.PortMapping. $ usp add Device.NAT.PortMapping. { Alias: 'cpe-1' }
del
Delete object at path
USAGE $ usp del PATH
EXAMPLE $ usp del Device.NAT.PortMapping.1.
sniffer
Puts cli in mode that displays all incoming messages with pattern matching (default pattern .*)
USAGE $ sniffer PATTERN
EXAMPLE $ usp sniffer $ usp sniffer NOTIF@.*
subscribe
Subscribe to events
Possible event types: | Event | ValueChange | ObjectCreation | ObjectDeletion | OperationComplete | OnBoardRequest
USAGE $ usp subscribe
EXAMPLES $ usp subscribe ValueChange Device.Time.CurrentLocalTime $ usp subscribe Event Device.LocalAgent.Periodic!
version
Prints current cli version
USAGE $ version
EXAMPLE $ usp version