You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can download [pre-built binaries](https://github.com/TheThingsNetwork/lorawan-stack/releases) for your operating system and processor architecture.
$ sudo snap alias tti-lw-stack.tti-lw-cli tti-lw-cli
73
+
```
74
+
75
+
{{< note >}} When installing with `snap`, auto completion is enabled automatically. {{</ note >}}
76
+
77
+
To upgrade the CLI if it is already installed, use:
78
+
79
+
```bash
80
+
$ sudo snap refresh tti-lw-stack
81
+
```
82
+
83
+
{{< /tabs/tab >}}
84
+
85
+
{{< /tabs/container >}}
86
+
46
87
## Configuration
47
88
48
89
The command-line needs to be configured to connect to {{% tts %}}. You have multiple options to make the configuration file available to the CLI:
@@ -53,12 +94,18 @@ The command-line needs to be configured to connect to {{% tts %}}. You have mult
53
94
54
95
{{< warning >}} When using the snap packages, `~/.ttn-lw-cli.yml` will fail with permission errors. Choose a different path. {{</ warning >}}
55
96
97
+
{{< note >}} The default configuration file for both Open Source and Enterprise versions of the CLI is named `.ttn-lw-cli.yml`. {{</ note >}}
98
+
56
99
### Generate configuration file
57
100
58
101
If using {{% tts %}} Community Edition by The Things Network or {{% tts %}} Cloud, visit the addresses page for [The Things Network]({{< ref "getting-started/ttn/addresses" >}}) or [{{% tts %}} Cloud]({{< ref "getting-started/cloud-hosted/addresses" >}}) to find CLI configuration files for these deployments.
59
102
60
103
If hosting your own deployment, for example at `thethings.example.com`, all you need is:
61
104
105
+
{{< tabs/container "Open Source" "Enterprise" >}}
106
+
107
+
{{< tabs/tab "Open Source" >}}
108
+
62
109
```bash
63
110
$ ttn-lw-cli use thethings.example.com [--fetch-ca] [--user] [--overwrite]
{{< note >}} On Windows, use `ttn-lw-cli.exe` instead of `ttn-lw-cli`. {{</ note >}}
70
117
118
+
{{< /tabs/tab >}}
119
+
120
+
{{< tabs/tab "Enterprise" >}}
121
+
122
+
```bash
123
+
$ tti-lw-cli use thethings.example.com [--fetch-ca] [--user] [--overwrite]
124
+
```
125
+
126
+
{{< note >}} On Windows, use `tti-lw-cli.exe` instead of `tti-lw-cli`. {{</ note >}}
127
+
128
+
{{< /tabs/tab >}}
129
+
130
+
{{< /tabs/container >}}
131
+
71
132
This will generate and save the required CLI config file. By default, the file is saved on the current directory, use the `--user` to save it under the user config directory.
72
133
73
134
If the deployment is using a CA that is not already trusted by your system, use the `--fetch-ca` flag to also connect to the server and retrieve the CA required for establishing secure communication.
74
135
75
-
{{< note >}} If the file exists already, it is not overwritten and an error is printed instead. You can use `--overwrite` to overwrite the existing configuration file. {{</ note >}}
136
+
If the file exists already, it is not overwritten and an error is printed instead. You can use `--overwrite` to overwrite the existing configuration file.
76
137
77
138
{{< note >}} You can also use the `--grpc-port` and `--oauth-server-address` flags to override the default values for the gRPC port and the OAuth server address. These are not needed for standard deployments. {{</ note >}}
78
139
140
+
{{< note >}} If you are using an `https` port other than `443` (for example if you are running {{% tts %}} on localhost), you need to specify the OAuth server address by appending the `--oauth-server-address="https://localhost:8885/oauth"` flag when running the CLI.
141
+
142
+
If you are using a [custom certificate authority]({{< ref "/getting-started/installation/certificates#custom-certificate-authority" >}}), you will have to specify the `--ca="/path/to/ca.pem"` flag when running the CLI. {{</ note >}}
143
+
79
144
### Manually create configuration file
80
145
81
146
If using The Things Network or {{% tts %}} Cloud, visit the addresses page for [The Things Network]({{< ref "getting-started/ttn/addresses" >}}) or [{{% tts %}} Cloud]({{< ref "getting-started/cloud-hosted/addresses" >}}) to find CLI configuration files for these deployments.
{{< warning >}} If configuring `ttn-lw-cli` for {{% tts %}} Cloud, see [Cloud Addresses]({{< ref "getting-started/cloud-hosted/addresses" >}}) for information about endpoints.
99
168
{{</ warning >}}
100
169
101
-
If you are using an `https` port other than `443`, you need to specify that port, e.g.:
170
+
{{< /tabs/tab >}}
171
+
172
+
{{< tabs/tab "Enterprise" >}}
173
+
174
+
{{< /tabs/tab >}}
175
+
176
+
{{< /tabs/container >}}
177
+
178
+
If you are using an `https` port other than `443` (for example if running {{% tts %}} on localhost), you need to specify that port, e.g.:
If your deployment uses a custom certificate authority, you'll need to add:
184
+
If your deployment uses a custom certificate authority, you will need to add the following line in the configuration file:
108
185
109
186
```yaml
110
187
ca: /path/to/ca.pem
@@ -116,6 +193,10 @@ For advanced options, see the [Configuration Reference]({{< ref "/reference/conf
116
193
117
194
Auto completion allows the shell to [automatically fill in commands](https://en.wikipedia.org/wiki/Command-line_completion) after you type the first few letters. It is completely optional but can save you time entering commands.
118
195
196
+
{{< tabs/container "Open Source" "Enterprise" >}}
197
+
198
+
{{< tabs/tab "Open Source" >}}
199
+
119
200
Use `ttn-lw-cli complete` to generate an auto completion script for the `ttn-lw-cli` command. `bash`, `zsh`, `fish` and `powershell` shells are supported:
120
201
121
202
```bash
@@ -128,7 +209,7 @@ Source the file to enable auto completion:
128
209
$ . ./ttn-lw-cli-autocomplete
129
210
```
130
211
131
-
Alternatively, put in a default directory so that it is loaded automatically (This directory depends on your Operating System and your shell).
212
+
Alternatively, put in a default directory so that it is loaded automatically (this directory depends on your Operating System and your shell).
132
213
133
214
For `bash`, this directory is typically `/etc/bash_completion.d/`:
Use `tti-lw-cli complete` to generate an auto completion script for the `tti-lw-cli` command. `bash`, `zsh`, `fish` and `powershell` shells are supported:
Copy file name to clipboardExpand all lines: doc/content/getting-started/cli/login/_index.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,26 @@ This section explains how to login to {{% tts %}} using the command-line interfa
10
10
11
11
The CLI needs to be logged on in order to create gateways, applications, devices and API keys. With {{% tts %}} running, login with the following command:
12
12
13
+
{{< tabs/container "Open Source" "Enterprise" >}}
14
+
15
+
{{< tabs/tab "Open Source" >}}
16
+
13
17
```bash
14
18
$ ttn-lw-cli login
15
19
```
16
20
21
+
{{< /tabs/tab >}}
22
+
23
+
{{< tabs/tab "Enterprise" >}}
24
+
25
+
```bash
26
+
$ tti-lw-cli login
27
+
```
28
+
29
+
{{< /tabs/tab >}}
30
+
31
+
{{< /tabs/container >}}
32
+
17
33
This will open a browser window with the OAuth login page where you can login with your credentials. This is also where you can create a new account if you do not already have one.
18
34
19
35
{{< note >}} During the login procedure, the CLI starts a webserver on `localhost` in order to receive the OAuth callback after login. If you are running the CLI on a machine that is not `localhost`, you can pass the `--callback=false` flag. This will allow you to perform part of the OAuth flow on a different machine, and copy-paste a code back into the CLI. {{</ note >}}
0 commit comments