❗ NOTE: This CLI is currently considered an alpha release. It has currently has only a few specific features implemented and is a work in progress.
- Download the appropriate binary from the releases tab of the github page.
- Install it on your path and rename it to "smartthings". It does not need administrator privileges but of course will need to be executable.
- Run
smartthings --help
to make sure it's working. - Run a specific command with
smartthings <command>
NOTE: Some users are experiencing issues with the default login flow. If you are experiencing this issue, you can work around it by creating a personal access token and including it in your configuration file like this:
default:
token: my-personal-access-token
Many commands in the CLI handle complex input and/or output, mostly for use with the SmartThings REST API. 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.
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 . |
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.
Although not recommended, you can use a personal access token for authentication
by creating a configuration file and including the
token in a token
key for your profile.
- 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 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
.
Commands that use the SmartThings REST API are organized in a hierarchy that maps to that hierarchy.
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:upsert [ID] [VERSION]
smartthings capabilities:update [ID] [VERSION]
smartthings config [NAME]
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:presentation [ID]
smartthings devices:rename [ID] [LABEL]
smartthings devices:status [ID]
smartthings devices:update [ID]
smartthings generate:java
smartthings generate:node
smartthings help [COMMAND]
smartthings installedapps [ID]
smartthings installedapps:delete [ID]
smartthings installedapps:rename [ID] [NAME]
smartthings locations [IDORINDEX]
smartthings locations:create
smartthings locations:delete [ID]
smartthings locations:rooms [IDORINDEX]
smartthings locations:rooms:create
smartthings locations:rooms:delete [ID]
smartthings locations:rooms:update [ID]
smartthings locations:update [ID]
smartthings plugins
smartthings plugins:install PLUGIN...
smartthings plugins:link PLUGIN
smartthings plugins:uninstall PLUGIN...
smartthings plugins:update
smartthings presentation PRESENTATIONID [MANUFACTURERNAME]
smartthings presentation:device-config PRESENTATIONID
smartthings presentation:device-config:create
smartthings presentation:device-config:generate ID
smartthings rules [IDORINDEX]
smartthings rules:create
smartthings rules:delete [ID]
smartthings rules:update [ID]
smartthings schema [ID]
smartthings schema:authorize ARN
smartthings schema:create
smartthings schema:delete [ID]
smartthings schema:update [ID]
get a specific app or a list of apps
USAGE
$ smartthings apps [ID]
ARGUMENTS
ID the app id or number from list
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-v, --verbose include URLs and ARNs in table output
-y, --yaml use YAML format of input and/or output
--classification=classification filter results by one or more classifications, AUTOMATION, SERVICE, DEVICE,
CONNECTED_SERVICE
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
--type=type filter results by appType, WEBHOOK_SMART_APP, LAMBDA_SMART_APP, API_ONLY
See code: dist/commands/apps.ts
authorize calls to your AWS Lambda function from SmartThings
USAGE
$ smartthings apps:authorize ARN
ARGUMENTS
ARN the ARN of the AWS Lambda function
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
--principal=principal use this principal instead of the default when authorizing lambda functions
--statement-id=statement-id use this statement id instead of the default when authorizing lambda functions
EXAMPLES
$ smartthings apps:authorize arn:aws:lambda:us-east-1:1234567890:function:your-test-app
Note that 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-id smartthings --principal 906037444270 --action lambda:InvokeFunction
It requires your machine to be configured to run the AWS CLI
See code: dist/commands/apps/authorize.ts
update the OAuth settings of the app
USAGE
$ smartthings apps:create
OPTIONS
-d, --dry-run produce JSON but don't actually submit
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--authorize authorize Lambda functions to be called by SmartThings
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
--principal=principal use this principal instead of the default when authorizing lambda functions
--statement-id=statement-id use this statement id instead of the default when authorizing lambda functions
See code: dist/commands/apps/create.ts
delete the app
USAGE
$ smartthings apps:delete [ID]
ARGUMENTS
ID App profile UUID or number in the list
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
See code: dist/commands/apps/delete.ts
get OAuth settings of the app
USAGE
$ smartthings apps:oauth [ID]
ARGUMENTS
ID the app id or number in the list
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/apps/oauth.ts
update the OAuth settings of the app and regenerate the clientId and clientSecret
USAGE
$ smartthings apps:oauth:generate [ID]
ARGUMENTS
ID the app id
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/apps/oauth/generate.ts
update the OAuth settings of the app
USAGE
$ smartthings apps:oauth:update [ID]
ARGUMENTS
ID the app id
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/apps/oauth/update.ts
Send request to app target URL to confirm existence and authorize lifecycle events
USAGE
$ smartthings apps:register [ID]
ARGUMENTS
ID the app id
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
See code: dist/commands/apps/register.ts
get OAuth settings of the app
USAGE
$ smartthings apps:settings [ID]
ARGUMENTS
ID the app id
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/apps/settings.ts
update the OAuth settings of the app
USAGE
$ smartthings apps:settings:update [ID]
ARGUMENTS
ID the app id
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/apps/settings/update.ts
update the OAuth settings of the app
USAGE
$ smartthings apps:update [ID]
ARGUMENTS
ID the app id
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--authorize authorize Lambda functions to be called by SmartThings
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
--principal=principal use this principal instead of the default when authorizing lambda functions
--statement-id=statement-id use this statement id instead of the default when authorizing lambda functions
See code: dist/commands/apps/update.ts
display autocomplete installation instructions
USAGE
$ smartthings autocomplete [SHELL]
ARGUMENTS
SHELL shell type
OPTIONS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
EXAMPLES
$ smartthings autocomplete
$ smartthings autocomplete bash
$ smartthings autocomplete zsh
$ smartthings autocomplete --refresh-cache
See code: @oclif/plugin-autocomplete
get a specific capability
USAGE
$ smartthings capabilities [ID] [VERSION]
ARGUMENTS
ID the capability id or number in list
VERSION the capability version
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-n, --namespace=namespace a specific namespace to query; will use all by default
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-s, --standard show standard SmartThings capabilities
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/capabilities.ts
create a capability for a user
USAGE
$ smartthings capabilities:create
OPTIONS
-d, --dry-run produce JSON but don't actually submit
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-n, --namespace=namespace the namespace to create the capability under
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/capabilities/create.ts
delete a capability
USAGE
$ smartthings capabilities:delete [ID] [VERSION]
ARGUMENTS
ID the capability id
VERSION the capability version
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
See code: dist/commands/capabilities/delete.ts
list all capability namespaces currently available in a user account
USAGE
$ smartthings capabilities:namespaces
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/capabilities/namespaces.ts
get presentation information for a specific capability
USAGE
$ smartthings capabilities:presentation [ID] [VERSION]
ARGUMENTS
ID the capability id or number in list
VERSION the capability version
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-n, --namespace=namespace a specific namespace to query; will use all by default
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/capabilities/presentation.ts
create presentation model for a capability
USAGE
$ smartthings capabilities:presentation:create [ID] [VERSION]
ARGUMENTS
ID the capability id
VERSION the capability version
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/capabilities/presentation/create.ts
update presentation information of a capability
USAGE
$ smartthings capabilities:presentation:update [ID] [VERSION]
ARGUMENTS
ID the capability id
VERSION the capability version
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/capabilities/presentation/update.ts
Get list of locales supported by the capability
USAGE
$ smartthings capabilities:translations [ID] [VERSION] [TAG]
ARGUMENTS
ID the capability id or number in list
VERSION the capability version
TAG the locale tag
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-n, --namespace=namespace a specific namespace to query; will use all by default
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-v, --verbose include list of supported locales in table output
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
EXAMPLES
$ smartthings capabilities:translations
┌───┬─────────────────────────────┬─────────┬──────────┐
│ # │ Id │ Version │ Status │
├───┼─────────────────────────────┼─────────┼──────────┤
│ 1 │ custom1.outputModulation │ 1 │ proposed │
│ 2 │ custom1.outputVoltage │ 1 │ proposed │
└───┴─────────────────────────────┴─────────┴──────────┘
outputModulation (master)$ st capabilities:translations -v
┌───┬─────────────────────────────┬─────────┬──────────┬────────────┐
│ # │ Id │ Version │ Status │ Locales │
├───┼─────────────────────────────┼─────────┼──────────┼────────────┤
│ 1 │ custom1.outputModulation │ 1 │ proposed │ ko, en, es │
│ 2 │ custom1.outputVoltage │ 1 │ proposed │ en │
└───┴─────────────────────────────┴─────────┴──────────┴────────────┘
outputModulation (master)$ st capabilities:translations 1
outputModulation (master)$ st 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: dist/commands/capabilities/translations.ts
Create or update a capability translation
USAGE
$ smartthings capabilities:translations:upsert [ID] [VERSION]
ARGUMENTS
ID the capability id
VERSION the capability version
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
EXAMPLES
$ smartthings capabilities:translations:upsert custom1.outputModulation 1 -i en.yml
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.yml
┌───┬─────────────────────────────┬─────────┬──────────┐
│ # │ 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: dist/commands/capabilities/translations/upsert.ts
update a capability
USAGE
$ smartthings capabilities:update [ID] [VERSION]
ARGUMENTS
ID the capability id
VERSION the capability version
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/capabilities/update.ts
list config file entries
USAGE
$ smartthings config [NAME]
ARGUMENTS
NAME the config name
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-v, --verbose Include additional data in table output
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/config.ts
list all device profiles available in a user account or retrieve a single profile
USAGE
$ smartthings deviceprofiles [ID]
ARGUMENTS
ID device profile to retrieve; UUID or the number of the profile from list
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-v, --verbose include presentationId and manufacturerName in list output
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
ALIASES
$ smartthings device-profiles
EXAMPLES
$ smartthings deviceprofiles # list all device profiles
$ smartthings deviceprofiles bb0fdc5-...-a8bd2ea # show device profile with the specified UUID
$ smartthings deviceprofiles 2 # show the second device profile in the list
$ smartthings deviceprofiles 3 -j # show the profile in JSON format
$ smartthings deviceprofiles 5 -y # show the profile in YAML format
$ smartthings deviceprofiles 4 -j -o profile.json # write the profile to the file "profile.json"
See code: dist/commands/deviceprofiles.ts
Create a new device profile
USAGE
$ smartthings deviceprofiles:create
OPTIONS
-d, --dry-run produce JSON but don't actually submit
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
DESCRIPTION
Creates a new device profile. If a vid field is not present in the meta
then a default device presentation will be created for this profile and the
vid set to reference it.
EXAMPLES
$ smartthings deviceprofiles:create -i myprofile.json # create a device profile from the JSON file definition
$ smartthings deviceprofiles:create -i myprofile.yaml # create a device profile from the YAML file definition
$ smartthings deviceprofiles:create # create a device profile with interactive dialog
See code: dist/commands/deviceprofiles/create.ts
delete a device profile
USAGE
$ smartthings deviceprofiles:delete [ID]
ARGUMENTS
ID Device profile UUID or number in the list
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
EXAMPLES
$ smartthings deviceprofiles:delete 63b8c91e-9686-4c43-9afb-fbd9f77e3bb0 # delete profile with this UUID
$ smartthings deviceprofiles:delete 5 # delete the 5th profile in the list
See code: dist/commands/deviceprofiles/delete.ts
get the presentation associated with a device profile
USAGE
$ smartthings deviceprofiles:device-config [ID]
ARGUMENTS
ID device profile UUID or the number of the profile from list
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/deviceprofiles/device-config.ts
get the presentation associated with a device profile
USAGE
$ smartthings deviceprofiles:presentation [ID]
ARGUMENTS
ID device profile UUID or the number of the profile from list
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/deviceprofiles/presentation.ts
publish a device profile (published profiles cannot be modified)
USAGE
$ smartthings deviceprofiles:publish [ID]
ARGUMENTS
ID Device profile UUID or number in the list
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/deviceprofiles/publish.ts
Get list of locales supported by the device profiles
USAGE
$ smartthings deviceprofiles:translations [ID] [TAG]
ARGUMENTS
ID UUID or the number of the profile from list
TAG the locale tag or number of the tag from list
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-v, --verbose include list of locales in table output
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
EXAMPLES
$ smartthings deviceprofiles:translations
┌────┬─────────────────────┬─────────────┬──────────────────────────────────────┐
│ # │ Name │ Status │ Id │
├────┼─────────────────────┼─────────────┼──────────────────────────────────────┤
│ 1 │ Test Switch │ DEVELOPMENT │ 58e73d0c-b5a5-4814-b344-c10f4ff357bb │
│ 2 │ Two Channel Outlet │ DEVELOPMENT │ 3acbf2fc-6be2-4be0-aeb5-44759cbd66c2 │
└────┴─────────────────────┴─────────────┴──────────────────────────────────────┘
$ smartthings deviceprofiles:translations -v
┌────┬─────────────────────┬─────────────┬──────────────────────────────────────┬─────────┐
│ # │ Name │ Status │ Id │ Locales │
├────┼─────────────────────┼─────────────┼──────────────────────────────────────┼─────────┤
│ 1 │ Test Switch │ DEVELOPMENT │ 58e73d0c-b5a5-4814-b344-c10f4ff357bb │ │
│ 2 │ Two Channel Outlet │ DEVELOPMENT │ 3acbf2fc-6be2-4be0-aeb5-44759cbd66c2 │ en, es │
└────┴─────────────────────┴─────────────┴──────────────────────────────────────┴─────────┘
$ smartthings deviceprofiles:translations 2
$ smartthings deviceprofiles:translations 3acbf2fc-6be2-4be0-aeb5-c10f4ff357bb
┌───┬─────┐
│ # │ Tag │
├───┼─────┤
│ 1 │ en │
│ 2 │ es │
└───┴─────┘
$ smartthings deviceprofiles:translations 2 2
$ smartthings deviceprofiles:translations 2 en
$ smartthings deviceprofiles:translations 3acbf2fc-6be2-4be0-aeb5-44759cbd66c2 en
Tag: en
┌───────────┬────────────┬───────────────────────────────┐
│ Component │ Label │ Description │
├───────────┼────────────┼───────────────────────────────┤
│ main │ Main Power │ Controls power to all outlets │
│ outlet1 │ Outlet One │ Switchable outlet 1 power │
│ outlet2 │ Outlet two │ Switchable outlet 1 power │
└───────────┴────────────┴───────────────────────────────┘
See code: dist/commands/deviceprofiles/translations.ts
delete a device profile translation
USAGE
$ smartthings deviceprofiles:translations:delete [ID] [TAG]
ARGUMENTS
ID Device profile UUID or number in the list
TAG the locale tag
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
EXAMPLES
$ smartthings deviceprofiles:translations:delete 3acbf2fc-6be2-4be0-aeb5-44759cbd66c2 en
Device profile "3acbf2fc-6be2-4be0-aeb5-44759cbd66c2" translation "en" deleted
$ smartthings deviceprofiles:translations:delete
┌────┬─────────────────────┬─────────────┬──────────────────────────────────────┐
│ # │ Name │ Status │ Id │
├────┼─────────────────────┼─────────────┼──────────────────────────────────────┤
│ 1 │ Test Switch │ DEVELOPMENT │ 58e73d0c-b5a5-4814-b344-c10f4ff357bb │
│ 2 │ Two Channel Outlet │ DEVELOPMENT │ 3acbf2fc-6be2-4be0-aeb5-44759cbd66c2 │
└────┴─────────────────────┴─────────────┴──────────────────────────────────────┘
? Enter id or index 2
┌───┬─────┐
│ # │ Tag │
├───┼─────┤
│ 1 │ en │
│ 2 │ es │
└───┴─────┘
? Enter id or index 1
Device profile "3acbf2fc-6be2-4be0-aeb5-44759cbd66c2" translation "en" deleted
See code: dist/commands/deviceprofiles/translations/delete.ts
create or update a device profile translation
USAGE
$ smartthings deviceprofiles:translations:upsert [ID]
ARGUMENTS
ID UUID or the number of the profile from list
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
EXAMPLES
$ smartthings deviceprofiles:translations:upsert 3acbf2fc-6be2-4be0-aeb5-44759cbd66c2 -i en.yml
tag: en
components:
main:
label: Main Power
description: Controls power to all outlets
outlet1:
label: Outlet One
description: Switchable outlet 1 power
outlet2:
label: Outlet two
description: Switchable outlet 1 power
$ smartthings deviceprofiles:translations:upsert -i en.yml
┌────┬─────────────────────┬─────────────┬──────────────────────────────────────┐
│ # │ Name │ Status │ Id │
├────┼─────────────────────┼─────────────┼──────────────────────────────────────┤
│ 1 │ Test Switch │ DEVELOPMENT │ 58e73d0c-b5a5-4814-b344-c10f4ff357bb │
│ 2 │ Two Channel Outlet │ DEVELOPMENT │ 3acbf2fc-6be2-4be0-aeb5-44759cbd66c2 │
└────┴─────────────────────┴─────────────┴──────────────────────────────────────┘
? Enter id or index 2
tag: en
components:
main:
label: Main Power
description: Controls power to all outlets
outlet1:
label: Outlet One
description: Switchable outlet 1 power
outlet2:
label: Outlet two
description: Switchable outlet 1 power
See code: dist/commands/deviceprofiles/translations/upsert.ts
update a device profile
USAGE
$ smartthings deviceprofiles:update [ID]
ARGUMENTS
ID device profile UUID or number in the list
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/deviceprofiles/update.ts
Show device profile and device configuration in a single, consolidated view
USAGE
$ smartthings deviceprofiles:view [ID]
ARGUMENTS
ID Device profile UUID or the number from list
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/deviceprofiles/view.ts
Create a new device profile and device configuration.
USAGE
$ smartthings deviceprofiles:view:create
OPTIONS
-d, --dry-run produce JSON but don't actually submit
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
DESCRIPTION
Creates a new device profile and device configuration. Unlike deviceprofiles:create,
this command accepts a consolidated object that can include a device configration
in a property named "view".
EXAMPLES
$ smartthings deviceprofiles:view:create -i test.json
This test.json file defines a switch that cannot be controlled by the automations builder:
name: Test Switch
components:
- id: main
capabilities:
- id: switch
view:
dashboard:
states:
- capability: switch
actions:
- capability: switch
detailView:
- capability: switch
automation:
conditions:
- capability: switch
See code: dist/commands/deviceprofiles/view/create.ts
Update a device profile and configuration.
USAGE
$ smartthings deviceprofiles:view:update [ID]
ARGUMENTS
ID Device profile UUID or the number from list
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
DESCRIPTION
Updates a device profile and device configuration and sets the vid of the profile
to the vid of the updated configuration. Unlike deviceprofiles:update this
command accepts a consolidated object that can include a device configration
in a property named "view".
EXAMPLES
$ smartthings deviceprofiles:view:update 84042863-0d34-4c5c-b497-808daf230787 -i test.json
This test.json file adds the powerMeter capability to the device and makes it available in
the device detail view but not the rule builder:
components:
- id: main
capabilities:
- id: switch
- id: powerMeter
view:
dashboard:
states:
- capability: switch
actions:
- capability: switch
detailView:
- capability: switch
- capability: powerMeter
automation:
conditions:
- capability: switch
See code: dist/commands/deviceprofiles/view/update.ts
list all devices available in a user account or retrieve a single device
USAGE
$ smartthings devices [ID]
ARGUMENTS
ID device to retrieve; UUID or the number of the device from list
OPTIONS
-C, --capabilities-mode=and|or Treat capability filter query params as a logical "or" or "and" with a
default of "and".
-a, --installed-app-id=installed-app-id filter results by installed app that created the device
-c, --capability=capability filter results by capability
-d, --device-id=device-id filter results by device
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-l, --location-id=location-id filter results by location
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-v, --verbose include location name in output
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/devices.ts
get the current status of all of a device capabilities's attributes
USAGE
$ smartthings devices:capability-status [ID] [COMPONENT] [CAPABILITY]
ARGUMENTS
ID the device id
COMPONENT the component id
CAPABILITY the capability id
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/devices/capability-status.ts
execute a device command
USAGE
$ smartthings devices:commands [ID] [COMMAND]
ARGUMENTS
ID the device id
COMMAND the command [<component>]:<capability>:<command>([<arguments>])
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/devices/commands.ts
get the current status of a device component's attributes
USAGE
$ smartthings devices:component-status [ID] [COMPONENT]
ARGUMENTS
ID the device id
COMPONENT the component id
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/devices/component-status.ts
delete a device
USAGE
$ smartthings devices:delete [ID]
ARGUMENTS
ID device UUID
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
See code: dist/commands/devices/delete.ts
get the current health status of a device
USAGE
$ smartthings devices:health [ID]
ARGUMENTS
ID the device id
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/devices/health.ts
get a device presentation
USAGE
$ smartthings devices:presentation [ID]
ARGUMENTS
ID the device id or number in the list
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/devices/presentation.ts
rename a device
USAGE
$ smartthings devices:rename [ID] [LABEL]
ARGUMENTS
ID the device id
LABEL the new device label
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/devices/rename.ts
get the current status of all of a device's component's attributes
USAGE
$ smartthings devices:status [ID]
ARGUMENTS
ID the device id
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/devices/status.ts
get the current status of all of a device's component's attributes
USAGE
$ smartthings devices:update [ID]
ARGUMENTS
ID the device id
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/devices/update.ts
generate a Java starter app
USAGE
$ smartthings generate:java
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
See code: dist/commands/generate/java.ts
generate a NodeJS starter app
USAGE
$ smartthings generate:node
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
See code: dist/commands/generate/node.ts
display help for smartthings
USAGE
$ smartthings help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
get a specific app or a list of apps
USAGE
$ smartthings installedapps [ID]
ARGUMENTS
ID the app id
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-v, --verbose include location name in output
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/installedapps.ts
delete the installed app instance
USAGE
$ smartthings installedapps:delete [ID]
ARGUMENTS
ID installed app UUID
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
See code: dist/commands/installedapps/delete.ts
renamed an installed app instance
USAGE
$ smartthings installedapps:rename [ID] [NAME]
ARGUMENTS
ID the installed app id
NAME the new installed app name
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/installedapps/rename.ts
get a specific Location
USAGE
$ smartthings locations [IDORINDEX]
ARGUMENTS
IDORINDEX the location id or number in list
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/locations.ts
create a Location for a user
USAGE
$ smartthings locations:create
OPTIONS
-d, --dry-run produce JSON but don't actually submit
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/locations/create.ts
delete a location
USAGE
$ smartthings locations:delete [ID]
ARGUMENTS
ID location id
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
See code: dist/commands/locations/delete.ts
get a specific room
USAGE
$ smartthings locations:rooms [IDORINDEX]
ARGUMENTS
IDORINDEX room UUID or index
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-l, --locationId=locationId a specific locationId to query
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
ALIASES
$ smartthings rooms
See code: dist/commands/locations/rooms.ts
create a room
USAGE
$ smartthings locations:rooms:create
OPTIONS
-d, --dry-run produce JSON but don't actually submit
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-l, --locationid=locationid a specific location to query
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
ALIASES
$ smartthings rooms:create
See code: dist/commands/locations/rooms/create.ts
delete a room
USAGE
$ smartthings locations:rooms:delete [ID]
ARGUMENTS
ID room UUID
OPTIONS
-h, --help show CLI help
-l, --locationId=locationId a specific location to query
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
ALIASES
$ smartthings rooms:delete
See code: dist/commands/locations/rooms/delete.ts
update a room
USAGE
$ smartthings locations:rooms:update [ID]
ARGUMENTS
ID room UUID
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-l, --locationId=locationId a specific locationId to query
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
ALIASES
$ smartthings rooms:update
See code: dist/commands/locations/rooms/update.ts
update a location
USAGE
$ smartthings locations:update [ID]
ARGUMENTS
ID the location id
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/locations/update.ts
list installed plugins
USAGE
$ smartthings plugins
OPTIONS
--core show core plugins
EXAMPLE
$ smartthings plugins
See code: @oclif/plugin-plugins
installs a plugin into the CLI
USAGE
$ smartthings plugins:install PLUGIN...
ARGUMENTS
PLUGIN plugin to install
OPTIONS
-f, --force yarn install with force flag
-h, --help show CLI help
-v, --verbose
DESCRIPTION
Can be installed from npm or a git url.
Installation of a user-installed plugin will override a core plugin.
e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
the CLI without the need to patch and update the whole CLI.
ALIASES
$ smartthings plugins:add
EXAMPLES
$ smartthings plugins:install myplugin
$ smartthings plugins:install https://github.com/someuser/someplugin
$ smartthings plugins:install someuser/someplugin
See code: @oclif/plugin-plugins
links a plugin into the CLI for development
USAGE
$ smartthings plugins:link PLUGIN
ARGUMENTS
PATH [default: .] path to plugin
OPTIONS
-h, --help show CLI help
-v, --verbose
DESCRIPTION
Installation of a linked plugin will override a user-installed or core plugin.
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
command will override the user-installed or core plugin implementation. This is useful for development work.
EXAMPLE
$ smartthings plugins:link myplugin
See code: @oclif/plugin-plugins
removes a plugin from the CLI
USAGE
$ smartthings plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
OPTIONS
-h, --help show CLI help
-v, --verbose
ALIASES
$ smartthings plugins:unlink
$ smartthings plugins:remove
See code: @oclif/plugin-plugins
update installed plugins
USAGE
$ smartthings plugins:update
OPTIONS
-h, --help show CLI help
-v, --verbose
See code: @oclif/plugin-plugins
query device presentation by vid
USAGE
$ smartthings presentation PRESENTATIONID [MANUFACTURERNAME]
ARGUMENTS
PRESENTATIONID system generated identifier that corresponds to a device presentation
MANUFACTURERNAME manufacturer name. Defaults to SmartThingsCommunity
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/presentation.ts
query device config by presentationId
USAGE
$ smartthings presentation:device-config PRESENTATIONID
ARGUMENTS
PRESENTATIONID system generated identifier that corresponds to a device presentation
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/presentation/device-config.ts
create a device config
USAGE
$ smartthings presentation:device-config:create
OPTIONS
-d, --dry-run produce JSON but don't actually submit
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/presentation/device-config/create.ts
generate the default device configuration
USAGE
$ smartthings presentation:device-config:generate ID
ARGUMENTS
ID the profile id (or legacy DTH id))
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--dth generate from legacy DTH id instead of a profile id
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
--type-shard-id=type-shard-id data management shard Id where the device type resides, only useful for legacy DTH type
integrations
See code: dist/commands/presentation/device-config/generate.ts
get a specific rule
USAGE
$ smartthings rules [IDORINDEX]
ARGUMENTS
IDORINDEX rule UUID or index
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-l, --locationId=locationId a specific locationId to query
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/rules.ts
create a rule
USAGE
$ smartthings rules:create
OPTIONS
-d, --dry-run produce JSON but don't actually submit
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-l, --locationid=locationid a specific location to query
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/rules/create.ts
delete a rule
USAGE
$ smartthings rules:delete [ID]
ARGUMENTS
ID rule UUID
OPTIONS
-h, --help show CLI help
-l, --locationId=locationId a specific location to query
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
See code: dist/commands/rules/delete.ts
update a rule
USAGE
$ smartthings rules:update [ID]
ARGUMENTS
ID rule UUID
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-l, --locationId=locationId a specific locationId to query
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/rules/update.ts
list all ST Schema Apps currently available in a user account
USAGE
$ smartthings schema [ID]
ARGUMENTS
ID the schema connector id
OPTIONS
-h, --help show CLI help
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-v, --verbose include ARN in output
-y, --yaml use YAML format of input and/or output
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
See code: dist/commands/schema.ts
authorize calls to your ST Schema Lambda function from SmartThings
USAGE
$ smartthings schema:authorize ARN
ARGUMENTS
ARN the ARN of the AWS Lambda function
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
--principal=principal use this principal instead of the default when authorizing lambda functions
--statement-id=statement-id use this statement id instead of the default when authorizing lambda functions
EXAMPLES
$ smartthings apps:authorize arn:aws:lambda:us-east-1:1234567890:function:your-test-app
Note that 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-id smartthings --principal 148790070172 --action lambda:InvokeFunction
It requires your machine to be configured to run the AWS CLI
See code: dist/commands/schema/authorize.ts
update an ST Schema connector
USAGE
$ smartthings schema:create
OPTIONS
-d, --dry-run produce JSON but don't actually submit
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--authorize authorize connector's Lambda functions to be called by SmartThings
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
--principal=principal use this principal instead of the default when authorizing lambda functions
--statement-id=statement-id use this statement id instead of the default when authorizing lambda functions
See code: dist/commands/schema/create.ts
delete the ST Schema connector
USAGE
$ smartthings schema:delete [ID]
ARGUMENTS
ID schema app id
OPTIONS
-h, --help show CLI help
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
See code: dist/commands/schema/delete.ts
update an ST Schema connector
USAGE
$ smartthings schema:update [ID]
ARGUMENTS
ID the app id
OPTIONS
-h, --help show CLI help
-i, --input=input specify input file
-j, --json use JSON format of input and/or output
-o, --output=output specify output file
-p, --profile=profile [default: default] configuration profile
-t, --token=token the auth token to use
-y, --yaml use YAML format of input and/or output
--authorize authorize Lambda functions to be called by SmartThings
--compact use compact table format with no lines between body rows
--expanded use expanded table format with a line between each body row
--indent=indent specify indentation for formatting JSON or YAML output
--principal=principal use this principal instead of the default when authorizing lambda functions
--statement-id=statement-id use this statement id instead of the default when authorizing lambda functions
See code: dist/commands/schema/update.ts
More details about configuration and logging in the CLI can be found on the configuration documentation page.
This is the monorepo for the SmartThings CLI. Currently, the following packages are included:
- cli - the CLI itself; @smartthings/cli node package
- lib - a library for use in the CLI and its extensions; @smartthings/cli-lib node package
- testlib - a library for use in the CLI and its extensions with utility methods to make testing with Jest easier; @smartthings/cli-testlib node package
The CLI uses lerna to manage multiple packages in a monorepo. Dependencies are hoisted during bootstrap by default.
To disable this, modify the following in lerna.json
.
"command": {
"bootstrap": {
"hoist": false
}
The CLI depends on the SmartThings Core SDK. To use a pre-release version for testing purposes, you'll need to make any required changes in both checked out repositories and then:
- Be sure you're using at least NodeJS version 12.
- In the root directory of the SDK
- run
npm install
. - run
npm link
. If you're using a globally-installed version of node, you might need to run this with admin privileges.
- run
- Install lerna globally with
npm -g i lerna
. (Alternatively, you can usenpx lerna
below instead of simplylerna
.) - In the in the root directory of the CLI repository run
./bootstrap.sh --reset --link-sdk
. - The bootstrap script will compile the CLI but you can:
- run
lerna run compile
to compile again, or - run
lerna run watch
to watch for changes and compile on the fly, or - run
lerna run build
to clean and compile
- run
- To run the CLI, run the
run
command in packages/cli/bin. You can create a link to this file to make it easier to run. Since the final installed name will be "smartthings", that's a good name for the link. For example:ln -s ~/mydevdir/smartthings-cli/packages/cli/bin/run ~/bin/smartthings
There is also a full_clean.sh
script you can run to start over again. This is
sometimes helpful when pulling new code.
Before opening a pull request be sure to:
- Run eslint via
lerna run lint
- Run tests with
lerna run test
- If you've added or or removed commands or updated any of their arguments
or flags, be sure to update the readme. Doing a full build via
lerna run build
will do this but you can also runlerna run readme
.