Edge-related SmartThings CLI commands
npm install @smartthings/plugin-cli-edgeSmartThings Edge CLI Plugin
===========================
This is the home of the SmartThings CLI plugin for Edge Drivers. While it is a plugin with a
separate code base, it is installed by default with the SmartThings CLI. No additional setup is
necessary to begin using the Edge CLI plugin with the SmartThings CLI.
See the README for the CLI
for information on running the CLI.
* [smartthings edge:channels [IDORINDEX]](#smartthings-edgechannels-idorindex)
* [smartthings edge:channels:assign [DRIVERID] [VERSION]](#smartthings-edgechannelsassign-driverid-version)
* smartthings edge:channels:create
* [smartthings edge:channels:delete [ID]](#smartthings-edgechannelsdelete-id)
* [smartthings edge:channels:drivers [IDORINDEX]](#smartthings-edgechannelsdrivers-idorindex)
* [smartthings edge:channels:enroll [HUBID]](#smartthings-edgechannelsenroll-hubid)
* [smartthings edge:channels:enrollments [IDORINDEX]](#smartthings-edgechannelsenrollments-idorindex)
* [smartthings edge:channels:invites [IDORINDEX]](#smartthings-edgechannelsinvites-idorindex)
* smartthings edge:channels:invites:accept ID
* smartthings edge:channels:invites:create
* [smartthings edge:channels:invites:delete [ID]](#smartthings-edgechannelsinvitesdelete-id)
* [smartthings edge:channels:metainfo [IDORINDEX]](#smartthings-edgechannelsmetainfo-idorindex)
* [smartthings edge:channels:unassign [DRIVERID]](#smartthings-edgechannelsunassign-driverid)
* [smartthings edge:channels:unenroll [HUBID]](#smartthings-edgechannelsunenroll-hubid)
* [smartthings edge:channels:update [ID]](#smartthings-edgechannelsupdate-id)
* [smartthings edge:drivers [IDORINDEX]](#smartthings-edgedrivers-idorindex)
* [smartthings edge:drivers:default [IDORINDEX]](#smartthings-edgedriversdefault-idorindex)
* [smartthings edge:drivers:delete [ID]](#smartthings-edgedriversdelete-id)
* [smartthings edge:drivers:devices [IDORINDEX]](#smartthings-edgedriversdevices-idorindex)
* [smartthings edge:drivers:install [DRIVERID]](#smartthings-edgedriversinstall-driverid)
* [smartthings edge:drivers:installed [IDORINDEX]](#smartthings-edgedriversinstalled-idorindex)
* [smartthings edge:drivers:logcat [DRIVERID]](#smartthings-edgedriverslogcat-driverid)
* [smartthings edge:drivers:package [PROJECTDIRECTORY]](#smartthings-edgedriverspackage-projectdirectory)
* [smartthings edge:drivers:prune [DRIVERID]](#smartthings-edgedriversprune-driverid)
* [smartthings edge:drivers:switch [DEVICEID]](#smartthings-edgedriversswitch-deviceid)
* [smartthings edge:drivers:uninstall [DRIVERID]](#smartthings-edgedriversuninstall-driverid)
smartthings edge:channels [IDORINDEX]list all channels owned by you or retrieve a single channel
``
USAGE
$ smartthings edge:channels [IDORINDEX] [-h] [-p
[-y] [-o
ARGUMENTS
IDORINDEX the channel id or number in list
FLAGS
-A, --all-organizations include entities from all organizations the user belongs to
-I, --include-read-only include subscribed-to channels as well as owned channels
-O, --organization=
--subscriber-id=
--subscriber-type=
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
list all channels owned by you or retrieve a single channel
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/listChannels,
https://developer.smartthings.com/docs/api/public/#operation/channelById
EXAMPLES
# list all user-owned channels
$ smartthings edge:channels
# list user-owned and subscribed channels
$ smartthings edge:channels --include-read-only
# display details about the second channel listed when running "smartthings edge:channels"
$ smartthings edge:channels 2
# display channels subscribed to by the specified hub
$ smartthings edge:channels --subscriber-type HUB --subscriber-id
`
_See code: src/commands/edge/channels.ts_
assign a driver to a channel
`
USAGE
$ smartthings edge:channels:assign [DRIVERID] [VERSION] [-h] [-p
[-C
ARGUMENTS
DRIVERID driver id
VERSION driver version
FLAGS
-C, --channel=
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
assign a driver to a channel
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/createDriverChannel
`
_See code: src/commands/edge/channels/assign.ts_
create a channel
`
USAGE
$ smartthings edge:channels:create [-h] [-p
FLAGS
-O, --organization=
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
create a channel
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/createChannel
`
_See code: src/commands/edge/channels/create.ts_
delete a channel
`
USAGE
$ smartthings edge:channels:delete [ID] [-h] [-p
ARGUMENTS
ID channel id
FLAGS
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
delete a channel
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/deleteChannel
`
_See code: src/commands/edge/channels/delete.ts_
list drivers assigned to a given channel
`
USAGE
$ smartthings edge:channels:drivers [IDORINDEX] [-h] [-p
[-y] [-o
ARGUMENTS
IDORINDEX the channel id or number in list
FLAGS
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
list drivers assigned to a given channel
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/getChannelDrivers,
https://developer.smartthings.com/docs/api/public/#operation/getDriverChannel
`
_See code: src/commands/edge/channels/drivers.ts_
enroll a hub in a channel
`
USAGE
$ smartthings edge:channels:enroll [HUBID] [-h] [-p
ARGUMENTS
HUBID hub id
FLAGS
-C, --channel=
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
enroll a hub in a channel
`
_See code: src/commands/edge/channels/enroll.ts_
list all channels a given hub is enrolled in
`
USAGE
$ smartthings edge:channels:enrollments [IDORINDEX] [-h] [-p
[-y] [-o
ARGUMENTS
IDORINDEX the hub id or number in list
FLAGS
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
list all channels a given hub is enrolled in
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/listDriverChannels
`
_See code: src/commands/edge/channels/enrollments.ts_
list invitations or retrieve a single invitation by id or index
`
USAGE
$ smartthings edge:channels:invites [IDORINDEX] [-h] [-p
[-y] [-o
ARGUMENTS
IDORINDEX the invitation id or number in list
FLAGS
-C, --channel=
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
list invitations or retrieve a single invitation by id or index
EXAMPLES
$ smartthings edge:channels:invites # list all invites on all channels you own
$ smartthings edge:channels:invites 2 # list details about the second invite show when listed as in the example above
$ smartthings edge:channels:invites -C
$ smartthings edge:channels:invites
`
_See code: src/commands/edge/channels/invites.ts_
accept a channel invitation
`
USAGE
$ smartthings edge:channels:invites:accept [ID] [-h] [-p
ARGUMENTS
ID invite UUID
FLAGS
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
accept a channel invitation
`
_See code: src/commands/edge/channels/invites/accept.ts_
create an invitation
`
USAGE
$ smartthings edge:channels:invites:create [-h] [-p
FLAGS
-C, --channel=
-O, --organization=
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
create an invitation
`
_See code: src/commands/edge/channels/invites/create.ts_
delete a channel invitation
`
USAGE
$ smartthings edge:channels:invites:delete [ID] [-h] [-p
ARGUMENTS
ID invitation UUID
FLAGS
-C, --channel=
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
delete a channel invitation
`
_See code: src/commands/edge/channels/invites/delete.ts_
list all channels owned by you or retrieve a single channel
`
USAGE
$ smartthings edge:channels:metainfo [IDORINDEX] [-h] [-p
[-y] [-o
ARGUMENTS
IDORINDEX the channel id or number in list
FLAGS
-C, --channel=
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
list all channels owned by you or retrieve a single channel
EXAMPLES
# summarize metainfo for all drivers in a channel
$ smartthings edge:channels:metainfo
# summarize metainfo for all drivers in the specified channel
$ smartthings edge:channels:metainfo -C b50c0aa1-d9ea-4005-8db8-0cf9c2d9d7b2
# display metainfo about the third driver listed in the above command
$ smartthings edge:channels:metainfo -C b50c0aa1-d9ea-4005-8db8-0cf9c2d9d7b2 3
# display metainfo about a driver by using its id
$ smartthings edge:channels:metainfo -C b50c0aa1-d9ea-4005-8db8-0cf9c2d9d7b2 \
699c7308-8c72-4363-9571-880d0f5cc725
`
_See code: src/commands/edge/channels/metainfo.ts_
remove a driver from a channel
`
USAGE
$ smartthings edge:channels:unassign [DRIVERID] [-h] [-p
ARGUMENTS
DRIVERID driver id
FLAGS
-C, --channel=
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
remove a driver from a channel
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/deleteDriverChannel
`
_See code: src/commands/edge/channels/unassign.ts_
unenroll a hub from a channel
`
USAGE
$ smartthings edge:channels:unenroll [HUBID] [-h] [-p
ARGUMENTS
HUBID hub id
FLAGS
-C, --channel=
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
unenroll a hub from a channel
EXAMPLES
prompt user for hub and channel and then unenroll hub from channel
$ smartthings edge:channels:unenroll
prompt user for a channel the given hub is enrolled in and then unenroll it
$ smartthings edge:channels:unenroll 2fa0912f-cb73-424e-97f9-ffff76ea4f2a
unenroll the specified hub from the specified channel
$ smartthings edge:channels:unenroll 2fa0912f-cb73-424e-97f9-ffff76ea4f2a --channel \
fcd6ca9c-2764-4dbb-9bbe-d40c900c960f
`
_See code: src/commands/edge/channels/unenroll.ts_
update a channel
`
USAGE
$ smartthings edge:channels:update [ID] [-h] [-p
ARGUMENTS
ID the channel id
FLAGS
-O, --organization=
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
update a channel
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/updateChannel
`
_See code: src/commands/edge/channels/update.ts_
list all drivers owned by you or retrieve a single driver
`
USAGE
$ smartthings edge:drivers [IDORINDEX] [-h] [-p
[-y] [-o
ARGUMENTS
IDORINDEX the driver id or number in list
FLAGS
-A, --all-organizations include entities from all organizations the user belongs to
-O, --organization=
-V, --version=
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
list all drivers owned by you or retrieve a single driver
Use this command to list all drivers you own, even if they are not yet assigned to a channel.
See also edge:drivers:installed to list installed drivers and edge:channels:drivers to list drivers that are part of a
channel you own or have subscribed to
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/listDrivers,
https://developer.smartthings.com/docs/api/public/#operation/getDriver,
https://developer.smartthings.com/docs/api/public/#operation/getDriverRevision
EXAMPLES
# list all user-owned drivers
$ smartthings edge:drivers
# display details about the third driver listed in the above command
$ smartthings edge:drivers 3
# display details about a driver by using its id
$ smartthings edge:drivers 699c7308-8c72-4363-9571-880d0f5cc725
# get information on a specific version of a driver
$ smartthings edge:drivers 699c7308-8c72-4363-9571-880d0f5cc725 --version 2021-10-25T00:48:23.295969
`
_See code: src/commands/edge/drivers.ts_
list default drivers available to all users
`
USAGE
$ smartthings edge:drivers:default [IDORINDEX] [-h] [-p
[-y] [-o
ARGUMENTS
IDORINDEX the driver id or number in list
FLAGS
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
list default drivers available to all users
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/getDefaultDrivers
EXAMPLES
# list default drivers
$ smartthings edge:drivers:default
# show details about a specific default driver
$ smartthings edge:drivers:default 12
`
_See code: src/commands/edge/drivers/default.ts_
delete an edge driver
`
USAGE
$ smartthings edge:drivers:delete [ID] [-h] [-p
ARGUMENTS
ID driver UUID
FLAGS
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
delete an edge driver
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/deleteDriver
`
_See code: src/commands/edge/drivers/delete.ts_
list devices using edge drivers
`
USAGE
$ smartthings edge:drivers:devices [IDORINDEX] [-h] [-p
[-y] [-o
ARGUMENTS
IDORINDEX the device id or number in list
FLAGS
-D, --driver=
-H, --hub=
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
list devices using edge drivers
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/getDevices,
https://developer.smartthings.com/docs/api/public/#operation/listDrivers,
https://developer.smartthings.com/docs/api/public/#operation/getDriver,
https://developer.smartthings.com/docs/api/public/#operation/getDriverRevision
EXAMPLES
# list all devices using edge drivers
$ smartthings edge:drivers:devices
# display details about the third device listed in the above command
$ smartthings edge:drivers:devices 3
# display details about a device by using its id
$ smartthings edge:drivers:devices dfda0a8e-55d6-445b-ace5-db828679bcb3
# list all devices using edge drivers on the specified hub
$ smartthings edge:drivers:devices --hub a9108ab1-7087-4c10-9781-a0627b084fce
# list devices that use a specific driver
$ smartthings edge:drivers:devices --driver b67a134c-ace8-4b8d-9a0e-444ad78b4455
`
_See code: src/commands/edge/drivers/devices.ts_
install an edge driver onto a hub
`
USAGE
$ smartthings edge:drivers:install [DRIVERID] [-h] [-p
ARGUMENTS
DRIVERID id of driver to install
FLAGS
-C, --channel=
-H, --hub=
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
install an edge driver onto a hub
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/installDrivers
EXAMPLES
$ smartthings edge:drivers:install # use Q&A format to enter required values
$ smartthings edge:drivers:install -H
$ smartthings edge:drivers:install -H
`
_See code: src/commands/edge/drivers/install.ts_
list all drivers installed on a given hub
`
USAGE
$ smartthings edge:drivers:installed [IDORINDEX] [-h] [-p
[-y] [-o
ARGUMENTS
IDORINDEX the driver id or number in list
FLAGS
-H, --hub=
-O, --organization=
-v, --verbose include channel name in output
--device=
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
list all drivers installed on a given hub
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/listHubInstalledDrivers,
https://developer.smartthings.com/docs/api/public/#operation/getHubDeviceDriver
EXAMPLES
list all installed drivers
$ smartthings edge:drivers:installed
list all installed drivers and include the channel name in the output
$ smartthings edge:drivers:installed --verbose
list the first driver in the list retrieved by running "smartthings edge:drivers:installed"
$ smartthings edge:drivers:installed 1
list an installed driver by id
$ smartthings edge:drivers:installed
`
_See code: src/commands/edge/drivers/installed.ts_
stream logs from installed drivers
`
USAGE
$ smartthings edge:drivers:logcat [DRIVERID] [-h] [-p
ARGUMENTS
DRIVERID a specific driver to stream logs from
FLAGS
-a, --all stream from all installed drivers
--connect-timeout=
--hub-address=
--log-level=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
stream logs from installed drivers
`
_See code: src/commands/edge/drivers/logcat.ts_
build and upload an edge package
`
USAGE
$ smartthings edge:drivers:package [PROJECTDIRECTORY] [-h] [-p
[-j] [-y] [-o
ARGUMENTS
PROJECTDIRECTORY [default: .] directory containing project to upload
FLAGS
-I, --install prompt for hub (or use default if previously specified) to install to after assigning it
to the channel, implies --assign if --assign or --channel not included
-O, --organization=
-a, --assign prompt for a channel (or use default if previously specified) to assign the driver to
after upload
-b, --build-only=
-u, --upload=
--channel=
--hub=
not included
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=
-p, --profile=
-t, --token=
-y, --yaml use YAML format of input and/or output
--language=
DESCRIPTION
build and upload an edge package
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/uploadDriverPackage
EXAMPLES
# build and upload driver found in current directory:
$ smartthings edge:drivers:package
# build and upload driver found in current directory, assign it to a channel, and install it;
# user will be prompted for channel and hub
$ smartthings edge:drivers:package -I
# build and upload driver found in current directory then assign it to the specified channel
# and install it to the specified hub
$ smartthings edge:drivers:package --channel
# build and upload driver found in the my-driver directory
$ smartthings edge:drivers:package my-driver
# build the driver in the my-package directory and save it as driver.zip
$ smartthings edge:drivers:package -b driver.zip my-package
# upload the previously built driver found in driver.zip
$ smartthings edge:drivers:package -u driver.zip
`
_See code: src/commands/edge/drivers/package.ts_
uninstall unused edge drivers from a hub
`
USAGE
$ smartthings edge:drivers:prune [DRIVERID] [-h] [-p
ARGUMENTS
DRIVERID id of driver to uninstall
FLAGS
-H, --hub=
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
uninstall unused edge drivers from a hub
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/uninstallDriver
`
_See code: src/commands/edge/drivers/prune.ts_
change the driver used by an installed device
`
USAGE
$ smartthings edge:drivers:switch [DEVICEID] [-h] [-p
ARGUMENTS
DEVICEID id of device to update
FLAGS
-H, --hub=
-I, --include-non-matching when presenting a list of drivers to switch to, include drivers that do not match the
device
-O, --organization=
-d, --driver=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
change the driver used by an installed device
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/updateHubDevice
EXAMPLES
# switch driver, prompting user for all necessary input
$ smartthings edge:drivers:switch
# switch driver, including all necessary input on the command line
$ smartthings edge:drivers:switch --hub
# include all available drivers in prompt, even if they don't match the chosen device
$ smartthings edge:drivers:switch --include-non-matching
`
_See code: src/commands/edge/drivers/switch.ts_
uninstall an edge driver from a hub
`
USAGE
$ smartthings edge:drivers:uninstall [DRIVERID] [-h] [-p
ARGUMENTS
DRIVERID id of driver to uninstall
FLAGS
-H, --hub=
-O, --organization=
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=
-t, --token=
--language=
DESCRIPTION
uninstall an edge driver from a hub
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/uninstallDriver
``
_See code: src/commands/edge/drivers/uninstall.ts_
If you're a developer planning to work on the plugin, you can build and install
it this way.
* Node version 12 or later
* The latest release of the SmartThings CLI
1. npm install
1. npm run build
Install the plugin by linking it:
smartthings plugins:link ~path/to/this/repo