# SmartThings Developer CLI

**URL:** <https://community.smartthings.com/t/smartthings-developer-cli/199689>\
**Category:** Developer Programs\
**Created:** [July 17, 2020, 2:56pm UTC](https://community.smartthings.com/t/smartthings-developer-cli/199689 "2020-07-17T14:56:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jody.albritton](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jody.albritton/32/220661_2.png) [@jody.albritton](https://community.smartthings.com/u/jody.albritton)\
**Post date:** [July 17, 2020, 2:56pm UTC](https://community.smartthings.com/t/smartthings-developer-cli/199689/1 "2020-07-17T14:56:27Z")

</div>

# Developer CLI Community Documentation

# Usage

1. Download the appropriate binary from the  
[releases](https://github.com/SmartThingsCommunity/smartthings-cli/releases)  
tab of the github page.
2. Install it on your path and rename it to “smartthings”. It does not need  
administrator privileges but of course 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. 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`. |

## Configuration

The CLI can be configured by creating a YAML file called `config.yaml` in the  
following location:

- `$HOME/.config/@smartthings/cli` on OS/X or Linux
- `%LOCALAPPDATA%\@smartthings\cli` on Windows

## 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.

More details about configuration of the CLI can be found on the [configuration documentation page](https://github.com/SmartThingsCommunity/smartthings-cli/blob/master/packages/cli/doc/configuration.md).

# 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.

## [More Info](https://github.com/SmartThingsCommunity/smartthings-cli/blob/master/packages/cli/README.md)

---

<div class="post-metadata">

**Author:** ![Panos](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/panos/32/105171_2.png) [@Panos](https://community.smartthings.com/u/Panos)\
**Post date:** [August 1, 2020, 2:28pm UTC](https://community.smartthings.com/t/smartthings-developer-cli/199689/2 "2020-08-01T14:28:07Z")

</div>

@jody.albritton  
I can’t make this to work.  
I downloaded CLI pre4 for Mac OS and when I issue the command “st apps”, the terminal opens a new browser tab and prompt me to authorize the CLI to have access to my ST account.  
After that, I authorize the action a new message tell me to close the tab, but CLI does not return anything.  
Only the “One dot after another” loading but no response from webpage

---

<div class="post-metadata">

**Author:** ![jody.albritton](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jody.albritton/32/220661_2.png) [@jody.albritton](https://community.smartthings.com/u/jody.albritton)\
**Post date:** [August 2, 2020, 7:28am UTC](https://community.smartthings.com/t/smartthings-developer-cli/199689/3 "2020-08-02T07:28:52Z")

</div>

If you cannot get the authorization to work you can create the config manually.

> <https://github.com/SmartThingsCommunity/smartthings-cli/blob/master/packages/cli/doc/configuration.md>

---

<div class="post-metadata">

**Author:** ![Panos](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/panos/32/105171_2.png) [@Panos](https://community.smartthings.com/u/Panos)\
**Post date:** [August 2, 2020, 8:34am UTC](https://community.smartthings.com/t/smartthings-developer-cli/199689/4 "2020-08-02T08:34:42Z")

</div>

@jody.albritton

Thanks for your reply.  
It works for me!!

---

<div class="post-metadata">

**Author:** ![scottinpollock](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/scottinpollock/32/67273_2.png) [@scottinpollock](https://community.smartthings.com/u/scottinpollock)\
**Post date:** [August 2, 2020, 10:27am UTC](https://community.smartthings.com/t/smartthings-developer-cli/199689/5 "2020-08-02T10:27:20Z")

</div>

System requirements for macOS?

---

<div class="post-metadata">

**Author:** ![jody.albritton](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jody.albritton/32/220661_2.png) [@jody.albritton](https://community.smartthings.com/u/jody.albritton)\
**Post date:** [August 2, 2020, 6:14pm UTC](https://community.smartthings.com/t/smartthings-developer-cli/199689/6 "2020-08-02T18:14:01Z")

</div>

Like access to your system or resource usage?

It’s a simple stand alone executable that provides a wrapper for a typescript based CLI. I don’t think we have done any exhaustive tests on memory or cpu usage at this point.

---

<div class="post-metadata">

**Author:** ![scottinpollock](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/scottinpollock/32/67273_2.png) [@scottinpollock](https://community.smartthings.com/u/scottinpollock)\
**Post date:** [August 2, 2020, 7:31pm UTC](https://community.smartthings.com/t/smartthings-developer-cli/199689/7 "2020-08-02T19:31:31Z")

</div>

Ok… will it run satisfactorily on Snow Leopard?

---

<div class="post-metadata">

**Author:** ![jody.albritton](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jody.albritton/32/220661_2.png) [@jody.albritton](https://community.smartthings.com/u/jody.albritton)\
**Post date:** [August 2, 2020, 7:55pm UTC](https://community.smartthings.com/t/smartthings-developer-cli/199689/8 "2020-08-02T19:55:28Z")

</div>

Haven’t tested but it should

---

<div class="post-metadata">

**Author:** ![GSzabados](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/gszabados/32/73805_2.png) [@GSzabados](https://community.smartthings.com/u/GSzabados)\
**Post date:** [August 2, 2020, 11:07pm UTC](https://community.smartthings.com/t/smartthings-developer-cli/199689/9 "2020-08-02T23:07:57Z")

</div>

@jody.albritton, would the Linux version work on ARM architecture, like a RPi?

If not, would be possible to release a compiled version for ARM as well?
