@smartthings/cli
v1.10.2
Published
Command Line Interface for the SmartThings APIs
Downloads
173
Keywords
Readme
Overview
SmartThings CLI
The SmartThings CLI is a tool to help with developing SmartApps and drivers for the SmartThings ecosystem.
Usage
Installation
Homebrew (macOS)
brew install smartthingscommunity/smartthings/smartthings
Windows
Download and run the smartthings.msi
installer from the latest Release.
Standalone Installation (Linux and others)
- Download the appropriate zipped binary from the latest Release.
- Extract and install it on your system path. It does not need administrator privileges but will need to be executable.
Verify Installation
Run smartthings --version
and verify the version matches the latest release.
Getting Started
- Run
smartthings --help
to get more information on each command. - Run a specific command with
smartthings <command>
.
Input and Output Considerations
Many commands in the CLI handle complex input and/or output, mostly for use with the SmartThings REST API.
Complex input can always be passed as JSON or YAML and in a couple cases a "question and answer" mode is provided.
The output format will match the input format unless otherwise specified. When there is no input specified the default will be a user-friendly (often table) formatted style if the output is going to the console or JSON otherwise.
| Name | Shortcut | Description |
| -- | -- | -- |
| json | j | Write output in JSON format. |
| yaml | y | Write output in YAML format. |
| indent | | Specify the number of spaces for YAML or JSON output |
| input | i | Specify a filename for input. |
| output | o | Specify a filename for output. The extension of this file will control its type unless overridden with --json
or --yaml
. |
Authentication
The CLI supports an automatic login flow that pops up a browser window asking you to log in and give the CLI permission to access your account. The CLI will automatically request login as needed.
You can also use a personal access token (PAT) for authentication by passing a --token <uuid>
flag to commands or by creating a
configuration file
and including the token in a token
key for your profile. We generally don't recommend this approach
since it less secure, given that PATs don't expire unless revoked by the user, but it can be useful when working with
headless servers or for users who frequently switch between accounts.
Helpful Hints
- You can get more specific information about any command or sub-hierarchy
of commands by using
--help
with a specific command or branch. For example, you can run any of the following commands for varying level of detail:smartthings capabilities --help
,smartthings capabilities:presentation --help
smartthings capabilities:presentation:create --help
- The CLI accepts data in YAML or JSON format and can output data in either format as well as the default table format.
- Commands that take input accept stdin or a file specified
by the
--input
(shortcut-i
) flag. - Commands that output data will output the data to stdout unless a file
is specified the using
--output (shortcut
-o`) flag. - When no output format is specified, the CLI outputs a summary of the most useful information
in table format. For full details, use
--json
(-j
) or--yaml
(-y
). - When a command takes input and results in output, the format of the output
will match the input format unless an output filename is specified
using
--output
with a different extension. - Command line flags must go after the command. Use
smartthings command -f flag
instead ofsmartthings -f flag command
. - You can open an issue to report a bug or ask a question.
Commands
Commands that use the SmartThings REST API are organized in topics that map to the API spec.
smartthings apps [ID]
smartthings apps:authorize ARN
smartthings apps:create
smartthings apps:delete [ID]
smartthings apps:oauth [ID]
smartthings apps:oauth:generate [ID]
smartthings apps:oauth:update [ID]
smartthings apps:register [ID]
smartthings apps:settings [ID]
smartthings apps:settings:update [ID]
smartthings apps:update [ID]
smartthings autocomplete [SHELL]
smartthings capabilities [ID] [VERSION]
smartthings capabilities:create
smartthings capabilities:delete [ID] [VERSION]
smartthings capabilities:namespaces
smartthings capabilities:presentation [ID] [VERSION]
smartthings capabilities:presentation:create [ID] [VERSION]
smartthings capabilities:presentation:update [ID] [VERSION]
smartthings capabilities:translations [ID] [VERSION] [TAG]
smartthings capabilities:translations:create [ID] [VERSION]
smartthings capabilities:translations:update [ID] [VERSION]
smartthings capabilities:translations:upsert [ID] [VERSION]
smartthings capabilities:update [ID] [VERSION]
smartthings config [NAME]
smartthings config:reset
smartthings devicepreferences [IDORINDEX]
smartthings devicepreferences:create
smartthings devicepreferences:translations [PREFERENCEID] [TAG]
smartthings devicepreferences:translations:create [PREFERENCEID]
smartthings devicepreferences:translations:update [PREFERENCEID]
smartthings devicepreferences:update [ID]
smartthings deviceprofiles [ID]
smartthings deviceprofiles:create
smartthings deviceprofiles:delete [ID]
smartthings deviceprofiles:device-config [ID]
smartthings deviceprofiles:presentation [ID]
smartthings deviceprofiles:publish [ID]
smartthings deviceprofiles:translations [ID] [TAG]
smartthings deviceprofiles:translations:delete [ID] [TAG]
smartthings deviceprofiles:translations:upsert [ID]
smartthings deviceprofiles:update [ID]
smartthings deviceprofiles:view [ID]
smartthings deviceprofiles:view:create
smartthings deviceprofiles:view:update [ID]
smartthings devices [ID]
smartthings devices:capability-status [ID] [COMPONENT] [CAPABILITY]
smartthings devices:commands [ID] [COMMAND]
smartthings devices:component-status [ID] [COMPONENT]
smartthings devices:delete [ID]
smartthings devices:health [ID]
smartthings devices:history [ID]
smartthings devices:preferences [ID]
smartthings devices:presentation [ID]
smartthings devices:rename [ID] [LABEL]
smartthings devices:status [ID]
smartthings devices:update [ID]
smartthings edge:channels [IDORINDEX]
smartthings edge:channels:assign [DRIVERID] [VERSION]
smartthings edge:channels:create
smartthings edge:channels:delete [ID]
smartthings edge:channels:drivers [IDORINDEX]
smartthings edge:channels:enroll [HUBID]
smartthings edge:channels:enrollments [IDORINDEX]
smartthings edge:channels:invites [IDORINDEX]
smartthings edge:channels:invites:accept ID
smartthings edge:channels:invites:create
smartthings edge:channels:invites:delete [ID]
smartthings edge:channels:metainfo [IDORINDEX]
smartthings edge:channels:unassign [DRIVERID]
smartthings edge:channels:unenroll [HUBID]
smartthings edge:channels:update [ID]
smartthings edge:drivers [IDORINDEX]
smartthings edge:drivers:default [IDORINDEX]
smartthings edge:drivers:delete [ID]
smartthings edge:drivers:devices [IDORINDEX]
smartthings edge:drivers:install [DRIVERID]
smartthings edge:drivers:installed [IDORINDEX]
smartthings edge:drivers:logcat [DRIVERID]
smartthings edge:drivers:package [PROJECTDIRECTORY]
smartthings edge:drivers:prune [DRIVERID]
smartthings edge:drivers:switch [DEVICEID]
smartthings edge:drivers:uninstall [DRIVERID]
smartthings help [COMMAND]
smartthings installedapps [ID]
smartthings installedapps:delete [ID]
smartthings installedapps:rename [ID] [NAME]
smartthings installedschema [ID]
smartthings installedschema:delete [ID]
smartthings invites:schema [IDORINDEX]
smartthings invites:schema:create
smartthings invites:schema:delete [ID]
smartthings locations [IDORINDEX]
smartthings locations:create
smartthings locations:delete [ID]
smartthings locations:history [ID]
smartthings locations:modes [IDORINDEX]
smartthings locations:modes:create
smartthings locations:modes:delete [ID]
smartthings locations:modes:getcurrent
smartthings locations:modes:setcurrent [ID]
smartthings locations:modes:update [ID]
smartthings locations:rooms [IDORINDEX]
smartthings locations:rooms:create
smartthings locations:rooms:delete [ID]
smartthings locations:rooms:update [ID]
smartthings locations:update [ID]
smartthings logout
smartthings organizations [ID]
smartthings organizations:current
smartthings plugins
smartthings plugins:install PLUGIN...
smartthings plugins:inspect PLUGIN...
smartthings plugins:install PLUGIN...
smartthings plugins:link PLUGIN
smartthings plugins:uninstall PLUGIN...
smartthings plugins:uninstall PLUGIN...
smartthings plugins:uninstall PLUGIN...
smartthings plugins:update
smartthings presentation PRESENTATIONID [MANUFACTURERNAME]
smartthings presentation:device-config PRESENTATIONID [MANUFACTURERNAME]
smartthings presentation:device-config:create
smartthings presentation:device-config:generate ID
smartthings rules [IDORINDEX]
smartthings rules:create
smartthings rules:delete [ID]
smartthings rules:execute [ID]
smartthings rules:update [ID]
smartthings scenes [IDORINDEX]
smartthings scenes:execute [ID]
smartthings schema [ID]
smartthings schema:authorize ARN
smartthings schema:create
smartthings schema:delete [ID]
smartthings schema:regenerate [ID]
smartthings schema:update [ID]
smartthings virtualdevices [ID]
smartthings virtualdevices:create
smartthings virtualdevices:create-standard
smartthings virtualdevices:delete [ID]
smartthings virtualdevices:events [ID] [NAME] [VALUE] [UNIT]
smartthings virtualdevices:update [ID]
smartthings apps [ID]
get a specific app or a list of apps
USAGE
$ smartthings apps [ID] [-h] [-p <value>] [-t <value>] [--language <value>] [-j] [-y] [-o <value>]
[--type <value>] [--classification <value>] [-v]
ARGUMENTS
ID the app id or number from list
FLAGS
-v, --verbose include URLs and ARNs in table output
--classification=<value>... filter results by one or more classifications, AUTOMATION, SERVICE, DEVICE,
CONNECTED_SERVICE
--type=<value> filter results by appType, WEBHOOK_SMART_APP, LAMBDA_SMART_APP, API_ONLY
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
get a specific app or a list of apps
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/listApps,
https://developer.smartthings.com/docs/api/public/#operation/getApp
EXAMPLES
list all apps
$ smartthings apps
list the first app in the list retrieved by running "smartthings apps"
$ smartthings apps 1
list an app by id
$ smartthings apps 5dfd6626-ab1d-42da-bb76-90def3153998
include URLs and ARNs in the output
$ smartthings apps --verbose
list SERVICE classification apps
$ smartthings apps --classification SERVICE
list API-only apps
$ smartthings apps --type API_ONLY
See code: src/commands/apps.ts
smartthings apps:authorize ARN
authorize calls to your AWS Lambda function from SmartThings
USAGE
$ smartthings apps:authorize [ARN] [-h] [-p <value>] [--principal <value>] [--statement <value>]
ARGUMENTS
ARN the ARN of the AWS Lambda function
FLAGS
--principal=<value> use this principal instead of the default when authorizing lambda functions
--statement=<value> use this statement id instead of the default when authorizing lambda functions
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=<value> [default: default] configuration profile
DESCRIPTION
authorize calls to your AWS Lambda function from SmartThings
EXAMPLES
authorize an app
NOTE: This command is the same as running the following with the AWS CLI:
$ aws lambda add-permission --region us-east-1 --function-name \
> arn:aws:lambda:us-east-1:1234567890:function:your-test-app \
> --statement smartthings --principal 906037444270 --action lambda:InvokeFunction
This command requires your machine to be configured to run the AWS CLI.
$ smartthings apps:authorize arn:aws:lambda:us-east-1:1234567890:function:your-test-app
See code: src/commands/apps/authorize.ts
smartthings apps:create
create an app
USAGE
$ smartthings apps:create [-h] [-p <value>] [-t <value>] [--language <value>] [-j] [-y] [-i <value>] [-o
<value>] [-d] [--authorize] [--principal <value>] [--statement <value>]
FLAGS
-d, --dry-run produce JSON but don't actually submit
--authorize authorize Lambda functions to be called by SmartThings
--principal=<value> use this principal instead of the default when authorizing lambda functions
--statement=<value> use this statement id instead of the default when authorizing lambda functions
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
create an app
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/createApp
EXAMPLES
create an OAuth-In app from prompted input
$ smartthings apps:create
create an app defined in "my-app.yaml"
$ smartthings apps:create -i my-app.yaml
create an app defined in "my-app.json" and then authorize it
(See "smartthings apps:authorize" for more information on authorization.)
$ smartthings apps:create -i my-app.json --authorize
See code: src/commands/apps/create.ts
smartthings apps:delete [ID]
delete an app
USAGE
$ smartthings apps:delete [ID] [-h] [-p <value>] [-t <value>] [--language <value>]
ARGUMENTS
ID app UUID
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
delete an app
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/deleteApp
EXAMPLES
select app to delete from list
$ smartthings apps:delete
delete a specific app by id
$ smartthings apps:delete 5dfd6626-ab1d-42da-bb76-90def3153998
See code: src/commands/apps/delete.ts
smartthings apps:oauth [ID]
get OAuth information for the app
USAGE
$ smartthings apps:oauth [ID] [-h] [-p <value>] [-t <value>] [--language <value>] [-j] [-y] [-o <value>]
ARGUMENTS
ID the app id or number in the list
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
get OAuth information for the app
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/getAppOauth
EXAMPLES
prompt for an app and list OAuth information for it
$ smartthings apps:oauth
list OAuth information for the second app in the list generated by "smartthings apps"
$ smartthings apps:oauth 2
list OAuth information for the app with the given id
$ smartthings apps:oauth 392bcb11-e251-44f3-b58b-17f93015f3aa
See code: src/commands/apps/oauth.ts
smartthings apps:oauth:generate [ID]
regenerate the OAuth clientId and clientSecret of an app
USAGE
$ smartthings apps:oauth:generate [ID] [-h] [-p <value>] [-t <value>] [--language <value>] [-j] [-y] [-i <value>] [-o
<value>] [-d]
ARGUMENTS
ID the app id
FLAGS
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
regenerate the OAuth clientId and clientSecret of an app
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/generateAppOauth
EXAMPLES
regenerate the OAuth clientId and clientSecret of the app with the given id
$ smartthings apps:oauth:generate 392bcb11-e251-44f3-b58b-17f93015f3aa
See code: src/commands/apps/oauth/generate.ts
smartthings apps:oauth:update [ID]
update the OAuth settings of an app
USAGE
$ smartthings apps:oauth:update [ID] [-h] [-p <value>] [-t <value>] [--language <value>] [-j] [-y] [-i <value>] [-o
<value>] [-d]
ARGUMENTS
ID the app id
FLAGS
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
update the OAuth settings of an app
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/updateAppOauth
EXAMPLES
prompt for an app and update its OAuth settings interactively"
$ smartthings apps:oauth:update
prompt for an app and update its OAuth settings using the data in "oauth-settings.json"
$ smartthings apps:oauth:update -i oauth-settings.json
update the OAuth settings for the app with the given id using the data in "oauth-settings.json"
$ smartthings apps:oauth:update 392bcb11-e251-44f3-b58b-17f93015f3aa -i oauth-settings.json
See code: src/commands/apps/oauth/update.ts
smartthings apps:register [ID]
send request to app target URL to confirm existence and authorize lifecycle events
USAGE
$ smartthings apps:register [ID] [-h] [-p <value>] [-t <value>] [--language <value>]
ARGUMENTS
ID the app id
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
send request to app target URL to confirm existence and authorize lifecycle events
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/register
EXAMPLES
send registration request to the app with the given id
$ smartthings apps:register 392bcb11-e251-44f3-b58b-17f93015f3aa
See code: src/commands/apps/register.ts
smartthings apps:settings [ID]
get the settings of an app
USAGE
$ smartthings apps:settings [ID] [-h] [-p <value>] [-t <value>] [--language <value>] [-j] [-y] [-o <value>]
ARGUMENTS
ID the app id
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
get the settings of an app
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/getAppSettings
EXAMPLES
choose an app from a list and get its settings
$ smartthings apps:settings
get the settings of the app with the given id
$ smartthings apps:settings 392bcb11-e251-44f3-b58b-17f93015f3aa
get the settings of the third app in the list generated by "smartthings apps"
$ smartthings apps:settings 3
See code: src/commands/apps/settings.ts
smartthings apps:settings:update [ID]
update the settings of an app
USAGE
$ smartthings apps:settings:update [ID] [-h] [-p <value>] [-t <value>] [--language <value>] [-j] [-y] [-i <value>] [-o
<value>] [-d]
ARGUMENTS
ID the app id
FLAGS
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
update the settings of an app
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/updateAppSettings
EXAMPLES
update the settings of the app with the given id using the data in "app-settings.json"
$ smartthings apps:settings:update 392bcb11-e251-44f3-b58b-17f93015f3aa -i app-settings.json
ask for the ID of an app to update and then update it using the data in "app-settings.json"
$ smartthings apps:settings:update -i app-settings.json
See code: src/commands/apps/settings/update.ts
smartthings apps:update [ID]
update the settings of the app
USAGE
$ smartthings apps:update [ID] [-h] [-p <value>] [-t <value>] [--language <value>] [-j] [-y] [-i <value>] [-o
<value>] [-d] [--authorize] [--principal <value>] [--statement <value>]
ARGUMENTS
ID the app id
FLAGS
-d, --dry-run produce JSON but don't actually submit
--authorize authorize Lambda functions to be called by SmartThings
--principal=<value> use this principal instead of the default when authorizing lambda functions
--statement=<value> use this statement id instead of the default when authorizing lambda functions
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
update the settings of the app
See apps:oauth:update and apps:oauth:generate for updating oauth-related data.
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/updateApp
EXAMPLES
prompt for an app and edit it interactively
$ smartthings apps:update
prompt for an app and update it using the data in "my-app.json"
$ smartthings apps:update -i my-app.json
update the app with the given id using the data in "my-app.json"
$ smartthings apps:update 392bcb11-e251-44f3-b58b-17f93015f3aa -i my-app.json
update the given app using the data in "my-app.json" and then authorize it
(See "smartthings apps:authorize" for more information on authorization.)
$ smartthings apps:update 392bcb11-e251-44f3-b58b-17f93015f3aa -i my-app.json --authorize
See code: src/commands/apps/update.ts
smartthings autocomplete [SHELL]
display autocomplete installation instructions
USAGE
$ smartthings autocomplete [SHELL] [-r]
ARGUMENTS
SHELL shell type
FLAGS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
DESCRIPTION
display autocomplete installation instructions
EXAMPLES
$ smartthings autocomplete
$ smartthings autocomplete bash
$ smartthings autocomplete zsh
$ smartthings autocomplete --refresh-cache
See code: @oclif/plugin-autocomplete
smartthings capabilities [ID] [VERSION]
get a specific capability or a list of capabilities
USAGE
$ smartthings capabilities [ID] [VERSION] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
[-y] [-o <value>] [-A] [-n <value>] [-s]
ARGUMENTS
ID the capability id or number in list
VERSION the capability version
FLAGS
-A, --all-organizations include entities from all organizations the user belongs to
-O, --organization=<value> the organization ID to use for this command
-n, --namespace=<value> a specific namespace to query; will use all by default
-s, --standard show standard SmartThings capabilities
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
get a specific capability or a list of capabilities
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/listNamespacedCapabilities,
https://developer.smartthings.com/docs/api/public/#operation/listCapabilities,
https://developer.smartthings.com/docs/api/public/#operation/getCapability
See code: src/commands/capabilities.ts
smartthings capabilities:create
create a capability for a user
USAGE
$ smartthings capabilities:create [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j] [-y] [-i
<value>] [-o <value>] [-d] [-n <value>]
FLAGS
-O, --organization=<value> the organization ID to use for this command
-d, --dry-run produce JSON but don't actually submit
-n, --namespace=<value> the namespace to create the capability under
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
create a capability for a user
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/createCapability
See code: src/commands/capabilities/create.ts
smartthings capabilities:delete [ID] [VERSION]
delete a capability
USAGE
$ smartthings capabilities:delete [ID] [VERSION] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>]
ARGUMENTS
ID the capability id
VERSION the capability version
FLAGS
-O, --organization=<value> the organization ID to use for this command
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
delete a capability
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/deleteCapability
See code: src/commands/capabilities/delete.ts
smartthings capabilities:namespaces
list all capability namespaces currently available in a user account
USAGE
$ smartthings capabilities:namespaces [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j] [-y] [-o
<value>]
FLAGS
-O, --organization=<value> the organization ID to use for this command
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
list all capability namespaces currently available in a user account
See code: src/commands/capabilities/namespaces.ts
smartthings capabilities:presentation [ID] [VERSION]
get presentation information for a specific capability
USAGE
$ smartthings capabilities:presentation [ID] [VERSION] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
[-y] [-o <value>] [-n <value>]
ARGUMENTS
ID the capability id or number in list
VERSION the capability version
FLAGS
-O, --organization=<value> the organization ID to use for this command
-n, --namespace=<value> a specific namespace to query; will use all by default
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
get presentation information for a specific capability
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/getCapabilityPresentation
See code: src/commands/capabilities/presentation.ts
smartthings capabilities:presentation:create [ID] [VERSION]
create presentation model for a capability
USAGE
$ smartthings capabilities:presentation:create [ID] [VERSION] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
[-y] [-i <value>] [-o <value>] [-d]
ARGUMENTS
ID the capability id
VERSION the capability version
FLAGS
-O, --organization=<value> the organization ID to use for this command
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
create presentation model for a capability
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/createCustomCapabilityPresentation
See code: src/commands/capabilities/presentation/create.ts
smartthings capabilities:presentation:update [ID] [VERSION]
update presentation information of a capability
USAGE
$ smartthings capabilities:presentation:update [ID] [VERSION] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
[-y] [-i <value>] [-o <value>] [-d]
ARGUMENTS
ID the capability id
VERSION the capability version
FLAGS
-O, --organization=<value> the organization ID to use for this command
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
update presentation information of a capability
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/updateCustomCapabilityPresentation
See code: src/commands/capabilities/presentation/update.ts
smartthings capabilities:translations [ID] [VERSION] [TAG]
get list of locales supported by the capability
USAGE
$ smartthings capabilities:translations [ID] [VERSION] [TAG] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>]
[-j] [-y] [-o <value>] [-n <value>] [-v]
ARGUMENTS
ID the capability id or number in list
VERSION the capability version
TAG the locale tag
FLAGS
-O, --organization=<value> the organization ID to use for this command
-n, --namespace=<value> a specific namespace to query; will use all by default
-v, --verbose include list of supported locales in table output
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
get list of locales supported by the capability
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/listCapabilityLocalizations,
https://developer.smartthings.com/docs/api/public/#operation/getCapabilityLocalization
EXAMPLES
$ smartthings capabilities:translations
┌───┬─────────────────────────────┬─────────┬──────────┐
│ # │ Id │ Version │ Status │
├───┼─────────────────────────────┼─────────┼──────────┤
│ 1 │ custom1.outputModulation │ 1 │ proposed │
│ 2 │ custom1.outputVoltage │ 1 │ proposed │
└───┴─────────────────────────────┴─────────┴──────────┘
? Select a capability. 1
┌───┬─────┐
│ # │ Tag │
├───┼─────┤
│ 1 │ en │
│ 2 │ ko │
└───┴─────┘
$ st capabilities:translations -v
┌───┬─────────────────────────────┬─────────┬──────────┬────────────┐
│ # │ Id │ Version │ Status │ Locales │
├───┼─────────────────────────────┼─────────┼──────────┼────────────┤
│ 1 │ custom1.outputModulation │ 1 │ proposed │ ko, en, es │
│ 2 │ custom1.outputVoltage │ 1 │ proposed │ en │
└───┴─────────────────────────────┴─────────┴──────────┴────────────┘
? Select a capability. 1
┌───┬─────┐
│ # │ Tag │
├───┼─────┤
│ 1 │ en │
│ 1 │ es │
│ 2 │ ko │
└───┴─────┘
$ smartthings capabilities:translations 1
$ smartthings capabilities:translations custom1.outputModulation
┌───┬─────┐
│ # │ Tag │
├───┼─────┤
│ 1 │ en │
│ 2 │ ko │
└───┴─────┘
$ smartthings capabilities:translations 1 1
$ smartthings capabilities:translations 1 en
$ smartthings capabilities:translations custom1.outputModulation 1 1
$ smartthings capabilities:translations custom1.outputModulation 1 en
$ smartthings capabilities:translations custom1.outputModulation en
Tag: en
Attributes:
┌────────────────────────┬───────────────────┬────────────────────────────────┬────────────────────────────────────────────────────┐
│ Name │ Label │ Description │ Template │
├────────────────────────┼───────────────────┼────────────────────────────────┼────────────────────────────────────────────────────┤
│ outputModulation │ Output Modulation │ Power supply output modulation │ The {{attribute}} of {{device.label}} is {{value}} │
│ outputModulation.50hz │ 50 Hz │ │ │
│ outputModulation.60hz │ 60 Hz │ │ │
└────────────────────────┴───────────────────┴────────────────────────────────┴────────────────────────────────────────────────────┘
Commands
┌──────────────────────────────────────┬───────────────────────┬──────────────────────────────────────────────────┐
│ Name │ Label │ Description │
├──────────────────────────────────────┼───────────────────────┼──────────────────────────────────────────────────┤
│ setOutputModulation │ Set Output Modulation │ Set the output modulation to the specified value │
│ setOutputModulation.outputModulation │ Output Modulation │ The desired output modulation │
└──────────────────────────────────────┴───────────────────────┴──────────────────────────────────────────────────┘
See code: src/commands/capabilities/translations.ts
smartthings capabilities:translations:create [ID] [VERSION]
create a capability translation
USAGE
$ smartthings capabilities:translations:create [ID] [VERSION] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
[-y] [-i <value>] [-o <value>] [-d]
ARGUMENTS
ID the capability id
VERSION the capability version
FLAGS
-O, --organization=<value> the organization ID to use for this command
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
create a capability translation
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/createCapabilityLocalization
EXAMPLES
$ smartthings capabilities:translations:create custom1.outputModulation 1 -i en.yaml
tag: en
label: Output Modulation
attributes:
outputModulation:
label: Output Modulation
displayTemplate: 'The {{attribute}} of {{device.label}} is {{value}}'
i18n:
value:
50hz:
label: 50 Hz
60hz:
label: 60 Hz
commands:
setOutputModulation:
label: Set Output Modulation
arguments:
outputModulation:
label: Output Modulation
$ smartthings capabilities:translations:create -i en.yaml
┌───┬─────────────────────────────┬─────────┬──────────┐
│ # │ Id │ Version │ Status │
├───┼─────────────────────────────┼─────────┼──────────┤
│ 1 │ custom1.outputModulation │ 1 │ proposed │
│ 2 │ custom1.outputVoltage │ 1 │ proposed │
└───┴─────────────────────────────┴─────────┴──────────┘
? Enter id or index 1
tag: en
label: Output Modulation
attributes:
outputModulation:
label: Output Modulation
displayTemplate: 'The {{attribute}} of {{device.label}} is {{value}}'
i18n:
value:
50hz:
label: 50 Hz
60hz:
label: 60 Hz
commands:
setOutputModulation:
label: Set Output Modulation
arguments:
outputModulation:
label: Output Modulation
See code: src/commands/capabilities/translations/create.ts
smartthings capabilities:translations:update [ID] [VERSION]
update a capability translation
USAGE
$ smartthings capabilities:translations:update [ID] [VERSION] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
[-y] [-i <value>] [-o <value>] [-d]
ARGUMENTS
ID the capability id
VERSION the capability version
FLAGS
-O, --organization=<value> the organization ID to use for this command
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
update a capability translation
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/updateCapabilityLocalization
EXAMPLES
$ smartthings capabilities:translations:update custom1.outputModulation 1 -i en.yaml
tag: en
label: Output Modulation
attributes:
outputModulation:
label: Output Modulation
displayTemplate: 'The {{attribute}} of {{device.label}} is {{value}}'
i18n:
value:
50hz:
label: 50 Hz
60hz:
label: 60 Hz
commands:
setOutputModulation:
label: Set Output Modulation
arguments:
outputModulation:
label: Output Modulation
$ smartthings capabilities:translations:update -i en.yaml
┌───┬─────────────────────────────┬─────────┬──────────┐
│ # │ Id │ Version │ Status │
├───┼─────────────────────────────┼─────────┼──────────┤
│ 1 │ custom1.outputModulation │ 1 │ proposed │
│ 2 │ custom1.outputVoltage │ 1 │ proposed │
└───┴─────────────────────────────┴─────────┴──────────┘
? Enter id or index 1
tag: en
label: Output Modulation
attributes:
outputModulation:
label: Output Modulation
displayTemplate: 'The {{attribute}} of {{device.label}} is {{value}}'
i18n:
value:
50hz:
label: 50 Hz
60hz:
label: 60 Hz
commands:
setOutputModulation:
label: Set Output Modulation
arguments:
outputModulation:
label: Output Modulation
See code: src/commands/capabilities/translations/update.ts
smartthings capabilities:translations:upsert [ID] [VERSION]
create or update a capability translation
USAGE
$ smartthings capabilities:translations:upsert [ID] [VERSION] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
[-y] [-i <value>] [-o <value>] [-d]
ARGUMENTS
ID the capability id
VERSION the capability version
FLAGS
-O, --organization=<value> the organization ID to use for this command
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
create or update a capability translation
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/updateCapabilityLocalization,
https://developer.smartthings.com/docs/api/public/#operation/createCapabilityLocalization
EXAMPLES
$ smartthings capabilities:translations:upsert custom1.outputModulation 1 -i en.yaml
tag: en
label: Output Modulation
attributes:
outputModulation:
label: Output Modulation
displayTemplate: 'The {{attribute}} of {{device.label}} is {{value}}'
i18n:
value:
50hz:
label: 50 Hz
60hz:
label: 60 Hz
commands:
setOutputModulation:
label: Set Output Modulation
arguments:
outputModulation:
label: Output Modulation
$ smartthings capabilities:translations:upsert -i en.yaml
┌───┬─────────────────────────────┬─────────┬──────────┐
│ # │ Id │ Version │ Status │
├───┼─────────────────────────────┼─────────┼──────────┤
│ 1 │ custom1.outputModulation │ 1 │ proposed │
│ 2 │ custom1.outputVoltage │ 1 │ proposed │
└───┴─────────────────────────────┴─────────┴──────────┘
? Enter id or index 1
tag: en
label: Output Modulation
attributes:
outputModulation:
label: Output Modulation
displayTemplate: 'The {{attribute}} of {{device.label}} is {{value}}'
i18n:
value:
50hz:
label: 50 Hz
60hz:
label: 60 Hz
commands:
setOutputModulation:
label: Set Output Modulation
arguments:
outputModulation:
label: Output Modulation
See code: src/commands/capabilities/translations/upsert.ts
smartthings capabilities:update [ID] [VERSION]
update a capability
USAGE
$ smartthings capabilities:update [ID] [VERSION] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
[-y] [-i <value>] [-o <value>] [-d]
ARGUMENTS
ID the capability id
VERSION the capability version
FLAGS
-O, --organization=<value> the organization ID to use for this command
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
update a capability
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/updateCapability
See code: src/commands/capabilities/update.ts
smartthings config [NAME]
list config file entries
USAGE
$ smartthings config [NAME] [-h] [-p <value>] [-j] [-y] [-o <value>] [-v]
ARGUMENTS
NAME the config name
FLAGS
-v, --verbose Include additional data in table output
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-y, --yaml use YAML format of input and/or output
DESCRIPTION
list config file entries
See code: src/commands/config.ts
smartthings config:reset
clear saved answers to questions
USAGE
$ smartthings config:reset [-h] [-p <value>]
COMMON FLAGS
-h, --help Show CLI help.
-p, --profile=<value> [default: default] configuration profile
DESCRIPTION
clear saved answers to questions
The CLI will occasionally ask you if you want it to remember the answer to a question, such as "Which hub do you want
to use?" You can use this command to clear those answers.
See code: src/commands/config/reset.ts
smartthings devicepreferences [IDORINDEX]
list device preferences or get information for a specific device preference
USAGE
$ smartthings devicepreferences [IDORINDEX] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
[-y] [-o <value>] [-A] [-n <value>] [-s]
ARGUMENTS
IDORINDEX device preference id or index
FLAGS
-A, --all-organizations include entities from all organizations the user belongs to
-O, --organization=<value> the organization ID to use for this command
-n, --namespace=<value> a specific namespace to query; will use all by default
-s, --standard show standard SmartThings device preferences
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
list device preferences or get information for a specific device preference
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/listPreferences,
https://developer.smartthings.com/docs/api/public/#operation/getPreferenceById
EXAMPLES
list all device preferences, sorted by title
$ smartthings devicepreferences
display details for preference with specified id
$ smartthings devicepreferences motionSensitivity
display details for second item in list of preferences when sorted by title
$ smartthings devicepreferences 2
display details for third preference as YAML
$ smartthings devicepreferences 3 -y
write details as JSON for third preference to dp.json
$ smartthings devicepreferences 3 -o dp.json
See code: src/commands/devicepreferences.ts
smartthings devicepreferences:create
create a device preference
USAGE
$ smartthings devicepreferences:create [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j] [-y] [-i
<value>] [-o <value>] [-d]
FLAGS
-O, --organization=<value> the organization ID to use for this command
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
create a device preference
For API information, see:
https://developer.smartthings.com/docs/api/public/#operation/createPreference
EXAMPLES
create a new device preference by answering questions
$ smartthings devicepreferences:create
generate a device preference by answering questions but do not actually create it
$ smartthings devicepreferences:create -d
create a new device preference defined by the file dp.json
$ smartthings devicepreferences:create -i dp.json
create a new device preference defined by the file dp.json and write the results to dp - saved.json
$ smartthings devicepreferences:create - i dp.json - o dp - saved.json
See code: src/commands/devicepreferences/create.ts
smartthings devicepreferences:translations [PREFERENCEID] [TAG]
get translated device preference values in a desired locale
USAGE
$ smartthings devicepreferences:translations [PREFERENCEID] [TAG] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>]
[-j] [-y] [-o <value>]
ARGUMENTS
PREFERENCEID device preference id or index
TAG the locale tag
FLAGS
-O, --organization=<value> the organization ID to use for this command
COMMON FLAGS
-h, --help Show CLI help.
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML format of input and/or output
--language=<value> ISO language code or "NONE" to not specify a language. Defaults to the OS locale
DESCRIPTION
get translated device preference values in a desired locale
EXAMPLES
answer a series of questions to choose device preference and list locales
$ smartthings devicepreferences:translation
list locales for a specific device preference ID
$ smartthings devicepreferences:translations motionSensitivity
specify device preference ID and locale to get translated device preference values
$ smartthings devicepreferences:translations motionSensitivity ko
See code: src/commands/devicepreferences/translations.ts
smartthings devicepreferences:translations:create [PREFERENCEID]
create a device preference translation
USAGE
$ smartthings devicepreferences:translations:create [PREFERENCEID] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
[-y] [-i <value>] [-o <value>] [-d]
ARGUMENTS
PREFERENCEID device preference id or index
FLAGS
-O, --organization=<value> the organization ID to use for this command
-d, --dry-run produce JSON but don't actually submit
COMMON FLAGS
-h, --help Show CLI help.
-i, --input=<value> specify input file
-j, --json use JSON format of input and/or output
-o, --output=<value> specify output file
-p, --profile=<value> [default: default] configuration profile
-t, --token=<value> the auth token to use
-y, --yaml use YAML forma