Nascent Prototype Metaverse

    @smartthings/cli

    1.0.0-beta.0 • Public • Published

    Overview

    oclif npm version npm License

    SmartThings Unified CLI

    ⚠️ 🚧 This CLI is currently in beta release. Please open an issue to report a bug or ask a question.

    Usage

    1. Download the appropriate binary from the releases tab of the github page.
    2. Install it on your path and rename it to "smartthings". It does not need administrator privileges but will need to be executable.
    3. Run smartthings --help to make sure it's working.
    4. 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

    1. 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
    2. The CLI accepts data in YAML or JSON format and can output data in either format as well as the default table format.
    3. Commands that take input accept stdin or a file specified by the --input (shortcut -i) flag.
    4. Commands that output data will output the data to stdout unless a file is specified the using --output (shortcut -o`) flag.
    5. 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.
    6. Command line flags must go after the command. Use smartthings command -f flag instead of smartthings -f flag command.

    Commands

    Commands that use the SmartThings REST API are organized in topics that map to the API spec.

    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 edge:channels [IDORINDEX]

    list all channels owned by you or retrieve a single channel

    USAGE
      $ smartthings edge:channels [IDORINDEX] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
        [-y] [-o <value>] [-A] [-I] [--subscriber-id <value> --subscriber-type HUB]
    
    ARGUMENTS
      IDORINDEX  the channel id or number in list
    
    FLAGS
      -A, --all-organizations     include entities from all organizations the user belongs to
      -I, --include-read-only     include subscribed-to channels as well as owned channels
      -O, --organization=<value>  The organization ID to use for this command
      -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
      --subscriber-id=<value>     filter results based on subscriber id (e.g. hub id)
      --subscriber-type=<option>  filter results based on subscriber type
                                  <options: HUB>
    
    DESCRIPTION
      list all channels owned by you or retrieve a single channel
    
    EXAMPLES
      # list all user-owned channels
      $ smartthings edge:channels
      # list user-owned and subscribed channels
      $ smartthings edge:channels --include-read-only
    
      # display details about the second channel listed when running "smartthings edge:channels"
      $ smartthings edge:channels 2
      # display channels subscribed to by the specified hub
      $ smartthings edge:channels --subscriber-type HUB --subscriber-id <hub-id>
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:assign [DRIVERID] [VERSION]

    assign a driver to a channel

    USAGE
      $ smartthings edge:channels:assign [DRIVERID] [VERSION] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>]
        [-C <value>]
    
    ARGUMENTS
      DRIVERID  driver id
      VERSION   driver version
    
    FLAGS
      -C, --channel=<value>       channel id
      -O, --organization=<value>  The organization ID to use for this command
      -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
      assign a driver to a channel
    
    ALIASES
      $ smartthings edge:drivers:publish
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:create

    create a channel

    USAGE
      $ smartthings edge:channels: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
      -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 channel
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:delete [ID]

    delete a channel

    USAGE
      $ smartthings edge:channels:delete [ID] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>]
    
    ARGUMENTS
      ID  channel id
    
    FLAGS
      -O, --organization=<value>  The organization ID to use for this command
      -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 channel
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:drivers [IDORINDEX]

    list all drivers assigned to a given channel

    USAGE
      $ smartthings edge:channels:drivers [IDORINDEX] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
        [-y] [-o <value>]
    
    ARGUMENTS
      IDORINDEX  the channel id or number in list
    
    FLAGS
      -O, --organization=<value>  The organization ID to use for this command
      -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 drivers assigned to a given channel
    
    ALIASES
      $ smartthings edge:channels:assignments
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:enroll [HUBID]

    enroll a hub in a channel

    USAGE
      $ smartthings edge:channels:enroll [HUBID] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-C
      <value>]
    
    ARGUMENTS
      HUBID  hub id
    
    FLAGS
      -C, --channel=<value>       channel id
      -O, --organization=<value>  The organization ID to use for this command
      -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
      enroll a hub in a channel
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:enrollments [IDORINDEX]

    list all channels a given hub is enrolled in

    USAGE
      $ smartthings edge:channels:enrollments [IDORINDEX] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
        [-y] [-o <value>]
    
    ARGUMENTS
      IDORINDEX  the hub id or number in list
    
    FLAGS
      -O, --organization=<value>  The organization ID to use for this command
      -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 channels a given hub is enrolled in
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:invites [IDORINDEX]

    list invitations or retrieve a single invitation by id or index

    USAGE
      $ smartthings edge:channels:invites [IDORINDEX] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
        [-y] [-o <value>] [-C <value>]
    
    ARGUMENTS
      IDORINDEX  the invitation id or number in list
    
    FLAGS
      -C, --channel=<value>       channel id
      -O, --organization=<value>  The organization ID to use for this command
      -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 invitations or retrieve a single invitation by id or index
    
    ALIASES
      $ smartthings edge:channels:invitations
    
    EXAMPLES
      $ smartthings edge:channels:invites                  # list all invites on all channels you own
    
      $ smartthings edge:channels:invites 2                # list details about the second invite show when listed as in the example above
    
      $ smartthings edge:channels:invites -C <channel id>  # list all invites on channel with id <channel id>
    
      $ smartthings edge:channels:invites <invite id>      # list details about the invite with id <invite id>
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:invites:accept ID

    accept a channel invitation

    USAGE
      $ smartthings edge:channels:invites:accept [ID] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>]
    
    ARGUMENTS
      ID  invite UUID
    
    FLAGS
      -O, --organization=<value>  The organization ID to use for this command
      -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
      accept a channel invitation
    
    ALIASES
      $ smartthings edge:channels:invitations:accept
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:invites:create

    create an invitation

    USAGE
      $ smartthings edge:channels:invites:create [-C <value> | -i <value>] [-h] [-p <value>] [-t <value>] [--language <value>] [-O
        <value>] [-j] [-y] [-o <value>] [-d]
    
    FLAGS
      -C, --channel=<value>       channel id
      -O, --organization=<value>  The organization ID to use for this command
      -d, --dry-run               produce JSON but don't actually submit
      -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 invitation
    
    ALIASES
      $ smartthings edge:channels:invitations:create
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:invites:delete [ID]

    delete a channel invitation

    USAGE
      $ smartthings edge:channels:invites:delete [ID] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-C
      <value>]
    
    ARGUMENTS
      ID  invitation UUID
    
    FLAGS
      -C, --channel=<value>       channel id
      -O, --organization=<value>  The organization ID to use for this command
      -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 channel invitation
    
    ALIASES
      $ smartthings edge:channels:invitations:revoke
      $ smartthings edge:channels:invitations:delete
      $ smartthings edge:channels:invites:revoke
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:metainfo [IDORINDEX]

    list all channels owned by you or retrieve a single channel

    USAGE
      $ smartthings edge:channels:metainfo [IDORINDEX] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
        [-y] [-o <value>] [-C <value> | ]
    
    ARGUMENTS
      IDORINDEX  the channel id or number in list
    
    FLAGS
      -C, --channel=<value>       channel id
      -O, --organization=<value>  The organization ID to use for this command
      -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 channels owned by you or retrieve a single channel
    
    EXAMPLES
      # summarize metainfo for all drivers in a channel
      $ smartthings edge:channels:metainfo
      # summarize metainfo for all drivers in the specified channel
      $ smartthings edge:channels:metainfo -C b50c0aa1-d9ea-4005-8db8-0cf9c2d9d7b2
      # display metainfo about the third driver listed in the above command
      $ smartthings edge:channels:metainfo -C b50c0aa1-d9ea-4005-8db8-0cf9c2d9d7b2 3
    
      # display metainfo about a driver by using its id
    
        $ smartthings edge:channels:metainfo -C b50c0aa1-d9ea-4005-8db8-0cf9c2d9d7b2 \
          699c7308-8c72-4363-9571-880d0f5cc725
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:unassign [DRIVERID]

    remove a driver from a channel

    USAGE
      $ smartthings edge:channels:unassign [DRIVERID] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-C
        <value>]
    
    ARGUMENTS
      DRIVERID  driver id
    
    FLAGS
      -C, --channel=<value>       channel id
      -O, --organization=<value>  The organization ID to use for this command
      -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
      remove a driver from a channel
    
    ALIASES
      $ smartthings edge:drivers:unpublish
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:unenroll [HUBID]

    unenroll a hub from a channel

    USAGE
      $ smartthings edge:channels:unenroll [HUBID] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-C
      <value>]
    
    ARGUMENTS
      HUBID  hub id
    
    FLAGS
      -C, --channel=<value>       channel id
      -O, --organization=<value>  The organization ID to use for this command
      -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
      unenroll a hub from a channel
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:channels:update [ID]

    update a channel

    USAGE
      $ smartthings edge:channels:update [ID] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j] [-y] [-i
        <value>] [-o <value>] [-d]
    
    ARGUMENTS
      ID  the channel id
    
    FLAGS
      -O, --organization=<value>  The organization ID to use for this command
      -d, --dry-run               produce JSON but don't actually submit
      -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 channel
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:drivers [IDORINDEX]

    list all drivers owned by you or retrieve a single driver

    USAGE
      $ smartthings edge:drivers [IDORINDEX] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
        [-y] [-o <value>] [-A] [-V <value>]
    
    ARGUMENTS
      IDORINDEX  the driver id or number in list
    
    FLAGS
      -A, --all-organizations     include entities from all organizations the user belongs to
      -O, --organization=<value>  The organization ID to use for this command
      -V, --version=<value>       driver version
      -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 drivers owned by you or retrieve a single driver
    
      Use this command to list all drivers you own, even if they are not yet assigned to a channel.
    
      See also:
    
      edge:drivers:installed to list installed drivers
    
      edge:channels:drivers to list drivers that are part of a channel you own or have subscribed to
    
    EXAMPLES
      # list all user-owned drivers
      $ smartthings edge:drivers
      # display details about the third driver listed in the above command
      $ smartthings edge:drivers 3
    
      # display details about a driver by using its id
      $ smartthings edge:drivers 699c7308-8c72-4363-9571-880d0f5cc725
      # get information on a specific version of a driver
      $ smartthings edge:drivers 699c7308-8c72-4363-9571-880d0f5cc725 --version 2021-10-25T00:48:23.295969
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:drivers:delete [ID]

    delete an edge driver

    USAGE
      $ smartthings edge:drivers:delete [ID] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>]
    
    ARGUMENTS
      ID  driver UUID
    
    FLAGS
      -O, --organization=<value>  The organization ID to use for this command
      -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 edge driver
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:drivers:install [DRIVERID]

    install an edge driver onto a hub

    USAGE
      $ smartthings edge:drivers:install [DRIVERID] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-H
        <value>] [-C <value>]
    
    ARGUMENTS
      DRIVERID  id of driver to install
    
    FLAGS
      -C, --channel=<value>       channel id
      -H, --hub=<value>           hub id
      -O, --organization=<value>  The organization ID to use for this command
      -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
      install an edge driver onto a hub
    
    EXAMPLES
      $ smartthings edge:drivers:install                                         # use Q&A format to enter required values
    
      $ smartthings edge:drivers:install -H <hub-id>                             # specify the hub on the command line, other fields will be asked for
    
      $ smartthings edge:drivers:install -H <hub-id> -C <channel-id> <driver-id> # install a driver from a channel on an enrolled hub
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:drivers:installed [IDORINDEX]

    list all drivers installed on a given hub

    USAGE
      $ smartthings edge:drivers:installed [IDORINDEX] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-j]
        [-y] [-o <value>] [-H <value>]
    
    ARGUMENTS
      IDORINDEX  the driver id or number in list
    
    FLAGS
      -H, --hub=<value>           hub id
      -O, --organization=<value>  The organization ID to use for this command
      -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 drivers installed on a given hub
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:drivers:logcat [DRIVERID]

    stream logs from installed drivers

    USAGE
      $ smartthings edge:drivers:logcat [DRIVERID] [-h] [-p <value>] [-t <value>] [--language <value>] [-a] [--hub-address
        <value>] [--connect-timeout <value>]
    
    ARGUMENTS
      DRIVERID  a specific driver to stream logs from
    
    FLAGS
      -a, --all                         stream from all installed drivers
      -h, --help                        Show CLI help.
      -p, --profile=<value>             [default: default] configuration profile
      -t, --token=<value>               the auth token to use
      --connect-timeout=<milliseconds>  [default: 30000] max time allowed when connecting to hub
      --hub-address=<value>             IPv4 address of hub with optionally appended port number
      --language=<value>                ISO language code or "NONE" to not specify a language. Defaults to the OS locale
    
    DESCRIPTION
      stream logs from installed drivers
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:drivers:package [PROJECTDIRECTORY]

    build and upload an edge package

    USAGE
      $ smartthings edge:drivers:package [PROJECTDIRECTORY] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>]
        [-j] [-y] [-o <value>] [-a | --channel <value> | [-b <value> | -u <value>]] [-I | --hub <value> | ]
    
    ARGUMENTS
      PROJECTDIRECTORY  [default: .] directory containing project to upload
    
    FLAGS
      -I, --install               prompt for hub to install to after assigning it to the channel, implies --assign if
                                  --assign or --channel not included
      -O, --organization=<value>  The organization ID to use for this command
      -a, --assign                prompt for a channel to assign the driver to after upload
      -b, --build-only=<value>    save package to specified zip file but skip upload
      -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
      -u, --upload=<value>        upload zip file previously built with --build flag
      -y, --yaml                  use YAML format of input and/or output
      --channel=<value>           automatically assign driver to specified channel after upload
      --hub=<value>               automatically install driver to specified hub, implies --assign if --assign or --channel
                                  not included
      --language=<value>          ISO language code or "NONE" to not specify a language. Defaults to the OS locale
    
    DESCRIPTION
      build and upload an edge package
    
    EXAMPLES
      # build and upload driver found in current directory:
      $ smartthings edge:drivers:package
      # build and upload driver found in current directory, assign it to a channel, and install it;
      # user will be prompted for channel and hub
      $ smartthings edge:drivers:package -I
      # build and upload driver found in current directory then assign it to the specified channel
      # and install it to the specified hub
      $ smartthings edge:drivers:package --channel <channel-id> --hub <hubId>
      # build and upload driver found in the my-driver directory
      $ smartthings edge:drivers:package my-driver
      # build the driver in the my-package directory and save it as driver.zip
      $ smartthings edge:drivers:package -b driver.zip my-package
    
      # upload the previously built driver found in driver.zip
    
        $ smartthings edge:drivers:package -u driver.zip
    

    See code: @smartthings/plugin-cli-edge

    smartthings edge:drivers:uninstall [DRIVERID]

    uninstall an edge driver from a hub

    USAGE
      $ smartthings edge:drivers:uninstall [DRIVERID] [-h] [-p <value>] [-t <value>] [--language <value>] [-O <value>] [-H
        <value>]
    
    ARGUMENTS
      DRIVERID  id of driver to uninstall
    
    FLAGS
      -H, --hub=<value>           hub id
      -O, --organization=<value>  The organization ID to use for this command
      -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
      uninstall an edge driver from a hub
    

    See code: @smartthings/plugin-cli-edge

    smartthings plugins

    List installed plugins.

    USAGE
      $ smartthings plugins [--core]
    
    FLAGS
      --core  Show core plugins.
    
    DESCRIPTION
      List installed plugins.
    
    EXAMPLES
      $ smartthings plugins
    

    See code: @oclif/plugin-plugins

    smartthings plugins:inspect PLUGIN...

    Displays installation properties of a plugin.

    USAGE
      $ smartthings plugins:inspect PLUGIN...
    
    ARGUMENTS
      PLUGIN  [default: .] Plugin to inspect.
    
    FLAGS
      -h, --help     Show CLI help.
      -v, --verbose
    
    DESCRIPTION
      Displays installation properties of a plugin.
    
    EXAMPLES
      $ smartthings plugins:inspect myplugin
    

    See code: @oclif/plugin-plugins

    smartthings plugins:install PLUGIN...

    Installs a plugin into the CLI.

    USAGE
      $ smartthings plugins:install PLUGIN...
    
    ARGUMENTS
      PLUGIN  Plugin to install.
    
    FLAGS
      -f, --force    Run yarn install with force flag.
      -h, --help     Show CLI help.
      -v, --verbose
    
    DESCRIPTION
      Installs a plugin into the CLI.
    
      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

    smartthings plugins:link PLUGIN

    Links a plugin into the CLI for development.

    USAGE
      $ smartthings plugins:link PLUGIN
    
    ARGUMENTS
      PATH  [default: .] path to plugin
    
    FLAGS
      -h, --help     Show CLI help.
      -v, --verbose
    
    DESCRIPTION
      Links a plugin into the CLI for development.
    
      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.
    
    EXAMPLES
      $ smartthings plugins:link myplugin
    

    See code: @oclif/plugin-plugins

    smartthings plugins:uninstall PLUGIN...

    Removes a plugin from the CLI.

    USAGE
      $ smartthings plugins:uninstall PLUGIN...
    
    ARGUMENTS
      PLUGIN  plugin to uninstall
    
    FLAGS
      -h, --help     Show CLI help.
      -v, --verbose
    
    DESCRIPTION
      Removes a plugin from the CLI.
    
    ALIASES
      $ smartthings plugins:unlink
      $ smartthings plugins:remove
    

    See code: @oclif/plugin-plugins

    smartthings plugins:update

    Update installed plugins.

    USAGE
      $ smartthings plugins:update [-h] [-v]
    
    FLAGS
      -h, --help     Show CLI help.
      -v, --verbose
    
    DESCRIPTION
      Update installed plugins.
    

    See code: @oclif/plugin-plugins

    Configuration and Logging

    More details about advanced configuration and logging in the CLI can be found on the configuration documentation page.

    Lerna Packages

    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

    Development

    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:

    1. Be sure you're using at least NodeJS version 12.
    2. In the root directory of the SDK
      1. run npm install.
      2. run npm link. If you're using a globally-installed version of node, you might need to run this with admin privileges.
    3. Install lerna globally with npm -g i lerna. (Alternatively, you can use npx lerna below instead of simply lerna.)
    4. In the in the root directory of the CLI repository run ./bootstrap.sh --reset --link-sdk.
    5. The bootstrap script will compile the CLI but you can:
      1. run lerna run compile to compile again, or
      2. run lerna run watch to watch for changes and compile on the fly, or
      3. run lerna run build to clean and compile
    6. 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:

    1. Run eslint via lerna run lint
    2. Run tests with lerna run test
    3. 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 run lerna run readme.

    Keywords

    Install

    npm i @smartthings/cli

    DownloadsWeekly Downloads

    10

    Version

    1.0.0-beta.0

    License

    Apache-2.0

    Unpacked Size

    55.8 kB

    Total Files

    8

    Last publish

    Collaborators

    • john-u
    • workmonk
    • xres
    • bflorian
    • erode
    • smartthingspi
    • rossiam
    • jodyalbritton