]> nmode's Git Repositories - signal-cli/blob - man/signal-cli.1.adoc
Allow calling signal-cli without -u flag
[signal-cli] / man / signal-cli.1.adoc
1 /////
2 vim:set ts=4 sw=4 tw=82 noet:
3 /////
4 :quotes.~:
5
6 = signal-cli (1)
7
8 == Name
9
10 signal-cli - A commandline and dbus interface for the Signal messenger
11
12 == Synopsis
13
14 *signal-cli* [--config CONFIG] [-h | -v | -u USERNAME | --dbus | --dbus-system] command [command-options]
15
16 == Description
17
18 signal-cli is a commandline interface for libsignal-service-java.
19 It supports registering, verifying, sending and receiving messages.
20 For registering you need a phone number where you can receive SMS or incoming calls.
21 signal-cli was primarily developed to be used on servers to notify admins of important events.
22 For this use-case, it has a dbus interface, that can be used to send messages from any programming language that has dbus bindings.
23
24 For some functionality the Signal protocol requires that all messages have been received from the server.
25 The `receive` command should be regularly executed. In daemon mode messages are continuously received.
26
27 == Options
28
29 *-h*, *--help*::
30 Show help message and quit.
31
32 *-v*, *--version*::
33 Print the version and quit.
34
35 *--verbose*::
36 Raise log level and include lib signal logs.
37
38 *--config* CONFIG::
39 Set the path, where to store the config.
40 Make sure you have full read/write access to the given directory.
41 (Default: `$XDG_DATA_HOME/signal-cli` (`$HOME/.local/share/signal-cli`))
42
43 *-u* USERNAME, *--username* USERNAME::
44 Specify your phone number, that will be your identifier.
45 The phone number must include the country calling code, i.e. the number must start with a "+" sign.
46
47 This flag must not be given for the `link` command.
48 It is optional for the `daemon` command.
49 For all other commands it is only optional if there is exactly one local user in the
50 config directory.
51
52 *--dbus*::
53 Make request via user dbus.
54
55 *--dbus-system*::
56 Make request via system dbus.
57
58 *-o* OUTPUT-MODE, *--output* OUTPUT-MODE::
59 Specify if you want commands to output in either "plain-text" mode or in "json". Defaults to "plain-text"
60
61 == Commands
62
63 === register
64
65 Register a phone number with SMS or voice verification.
66 Use the verify command to complete the verification.
67
68 *-v*, *--voice*::
69 The verification should be done over voice, not SMS.
70
71 *--captcha*::
72 The captcha token, required if registration failed with a captcha required error.
73 To get the token, go to https://signalcaptchas.org/registration/generate.html
74 Check the developer tools for a redirect starting with signalcaptcha://
75 Everything after signalcaptcha:// is the captcha token.
76
77 === verify
78
79 Verify the number using the code received via SMS or voice.
80
81 VERIFICATIONCODE::
82 The verification code.
83
84 *-p* PIN, *--pin* PIN::
85 The registration lock PIN, that was set by the user.
86 Only required if a PIN was set.
87
88 === unregister
89
90 Disable push support for this device, i.e. this device won't receive any more messages.
91 If this is the master device, other users can't send messages to this number anymore.
92 Use "updateAccount" to undo this.
93 To remove a linked device, use "removeDevice" from the master device.
94
95 === updateAccount
96
97 Update the account attributes on the signal server.
98 Can fix problems with receiving messages.
99
100 === setPin
101
102 Set a registration lock pin, to prevent others from registering this number.
103
104 REGISTRATION_LOCK_PIN::
105 The registration lock PIN, that will be required for new registrations (resets after 7 days of inactivity)
106
107 === removePin
108
109 Remove the registration lock pin.
110
111 === link
112
113 Link to an existing device, instead of registering a new number.
114 This shows a "tsdevice:/…" URI. If you want to connect to another signal-cli instance, you can just use this URI.
115 If you want to link to an Android/iOS device, create a QR code with the URI (e.g. with qrencode) and scan that in the Signal app.
116
117 *-n* NAME, *--name* NAME::
118 Optionally specify a name to describe this new device.
119 By default "cli" will be used.
120
121 === addDevice
122
123 Link another device to this device.
124 Only works, if this is the master device.
125
126 *--uri* URI::
127 Specify the uri contained in the QR code shown by the new device.
128 You will need the full uri enclosed in quotation marks, such as "tsdevice:/?uuid=....."
129
130 === listDevices
131
132 Show a list of connected devices.
133
134 === removeDevice
135
136 Remove a connected device.
137 Only works, if this is the master device.
138
139 *-d* DEVICEID, *--deviceId* DEVICEID::
140 Specify the device you want to remove.
141 Use listDevices to see the deviceIds.
142
143 === getUserStatus
144
145 Uses a list of phone numbers to determine the statuses of those users.
146 Shows if they are registered on the Signal Servers or not.
147 In json mode this is outputted as a list of objects.
148
149 [NUMBER [NUMBER ...]]::
150 One or more numbers to check.
151
152 === send
153
154 Send a message to another user or group.
155
156 RECIPIENT::
157 Specify the recipients’ phone number.
158
159 *-g* GROUP, *--group* GROUP::
160 Specify the recipient group ID in base64 encoding.
161
162 *-m* MESSAGE, *--message* MESSAGE::
163 Specify the message, if missing, standard input is used.
164
165 *-a* [ATTACHMENT [ATTACHMENT ...]], *--attachment* [ATTACHMENT [ATTACHMENT ...]]::
166 Add one or more files as attachment.
167
168 *-e*, *--endsession*::
169 Clear session state and send end session message.
170
171 === sendReaction
172
173 Send reaction to a previously received or sent message.
174
175 RECIPIENT::
176 Specify the recipients’ phone number.
177
178 *-g* GROUP, *--group* GROUP::
179 Specify the recipient group ID in base64 encoding.
180
181 *-e* EMOJI, *--emoji* EMOJI::
182 Specify the emoji, should be a single unicode grapheme cluster.
183
184 *-a* NUMBER, *--target-author* NUMBER::
185 Specify the number of the author of the message to which to react.
186
187 *-t* TIMESTAMP, *--target-timestamp* TIMESTAMP::
188 Specify the timestamp of the message to which to react.
189
190 *-r*, *--remove*::
191 Remove a reaction.
192
193 === receive
194
195 Query the server for new messages.
196 New messages are printed on standard output and attachments are downloaded to the config directory.
197 In json mode this is outputted as one json object per line.
198
199 *-t* TIMEOUT, *--timeout* TIMEOUT::
200 Number of seconds to wait for new messages (negative values disable timeout).
201 Default is 5 seconds.
202 *--ignore-attachments*::
203 Don’t download attachments of received messages.
204
205 === joinGroup
206
207 Join a group via an invitation link.
208 To be able to join a v2 group the account needs to have a profile (can be created
209 with the `updateProfile` command)
210
211 *--uri*::
212 The invitation link URI (starts with `https://signal.group/#`)
213
214 === updateGroup
215
216 Create or update a group.
217 If the user is a pending member, this command will accept the group invitation.
218 To be able to join or create a v2 group the account needs to have a profile (can
219 be created with the `updateProfile` command)
220
221 *-g* GROUP, *--group* GROUP::
222 Specify the recipient group ID in base64 encoding.
223 If not specified, a new group with a new random ID is generated.
224
225 *-n* NAME, *--name* NAME::
226 Specify the new group name.
227
228 *-a* AVATAR, *--avatar* AVATAR::
229 Specify a new group avatar image file.
230
231 *-m* [MEMBER [MEMBER ...]], *--member* [MEMBER [MEMBER ...]]::
232 Specify one or more members to add to the group.
233
234 === quitGroup
235
236 Send a quit group message to all group members and remove self from member list.
237 If the user is a pending member, this command will decline the group invitation.
238
239 *-g* GROUP, *--group* GROUP::
240 Specify the recipient group ID in base64 encoding.
241
242 === listGroups
243
244 Show a list of known groups and related information.
245 In json mode this is outputted as an list of objects and is always in detailed mode.
246
247 *-d*, *--detailed*::
248 Include the list of members of each group and the group invite link.
249
250 === listIdentities
251
252 List all known identity keys and their trust status, fingerprint and safety number.
253
254 *-n* NUMBER, *--number* NUMBER::
255 Only show identity keys for the given phone number.
256
257 === trust
258
259 Set the trust level of a given number.
260 The first time a key for a number is seen, it is trusted by default (TOFU).
261 If the key changes, the new key must be trusted manually.
262
263 number::
264 Specify the phone number, for which to set the trust.
265
266 *-a*, *--trust-all-known-keys*::
267 Trust all known keys of this user, only use this for testing.
268
269 *-v* VERIFIED_SAFETY_NUMBER, *--verified-safety-number* VERIFIED_SAFETY_NUMBER::
270 Specify the safety number of the key, only use this option if you have verified the safety number.
271
272 === updateProfile
273
274 Update the name and avatar image visible by message recipients for the current users.
275 The profile is stored encrypted on the Signal servers.
276 The decryption key is sent with every outgoing messages to contacts.
277
278 *--name*::
279 New name visible by message recipients.
280
281 *--avatar*::
282 Path to the new avatar visible by message recipients.
283
284 *--remove-avatar*::
285 Remove the avatar visible by message recipients.
286
287 === updateContact
288
289 Update the info associated to a number on our contact list.
290 This change is only local but can be synchronized to other devices by using `sendContacts` (see below).
291 If the contact doesn't exist yet, it will be added.
292
293 NUMBER::
294 Specify the contact phone number.
295
296 *-n*, *--name*::
297 Specify the new name for this contact.
298
299 *-e*, *--expiration*::
300 Set expiration time of messages (seconds).
301 To disable expiration set expiration time to 0.
302
303 === block
304
305 Block the given contacts or groups (no messages will be received).
306 This change is only local but can be synchronized to other devices by using `sendContacts` (see below).
307
308 [CONTACT [CONTACT ...]]::
309 Specify the phone numbers of contacts that should be blocked.
310
311 *-g* [GROUP [GROUP ...]], *--group* [GROUP [GROUP ...]]::
312 Specify the group IDs that should be blocked in base64 encoding.
313
314 === unblock
315
316 Unblock the given contacts or groups (messages will be received again).
317 This change is only local but can be synchronized to other devices by using `sendContacts` (see below).
318
319 [CONTACT [CONTACT ...]]::
320 Specify the phone numbers of contacts that should be unblocked.
321
322 *-g* [GROUP [GROUP ...]], *--group* [GROUP [GROUP ...]]::
323 Specify the group IDs that should be unblocked in base64 encoding.
324
325 === sendContacts
326
327 Send a synchronization message with the local contacts list to all linked devices.
328 This command should only be used if this is the master device.
329
330 === uploadStickerPack
331
332 Upload a new sticker pack, consisting of a manifest file and the stickers in WebP format (maximum size for a sticker file is 100KiB).
333 The required manifest.json has the following format:
334
335 [source,json]
336 ----
337 {
338 "title": "<STICKER_PACK_TITLE>",
339 "author": "<STICKER_PACK_AUTHOR>",
340 "cover": { // Optional cover, by default the first sticker is used as cover
341 "file": "<name of webp file, mandatory>",
342 "emoji": "<optional>"
343 },
344 "stickers": [
345 {
346 "file": "<name of webp file, mandatory>",
347 "emoji": "<optional>"
348 }
349 ...
350 ]
351 }
352 ----
353
354 PATH::
355 The path of the manifest.json or a zip file containing the sticker pack you wish to upload.
356
357 === daemon
358
359 signal-cli can run in daemon mode and provides an experimental dbus interface.
360 If no `-u` username is given, all local users will be exported as separate dbus
361 objects under the same bus name.
362
363 *--system*::
364 Use DBus system bus instead of user bus.
365 *--ignore-attachments*::
366 Don’t download attachments of received messages.
367
368 == Examples
369
370 Register a number (with SMS verification)::
371 signal-cli -u USERNAME register
372
373 Verify the number using the code received via SMS or voice::
374 signal-cli -u USERNAME verify CODE
375
376 Send a message to one or more recipients::
377 signal-cli -u USERNAME send -m "This is a message" [RECIPIENT [RECIPIENT ...]] [-a [ATTACHMENT [ATTACHMENT ...]]]
378
379 Pipe the message content from another process::
380 uname -a | signal-cli -u USERNAME send [RECIPIENT [RECIPIENT ...]]
381
382 Create a group::
383 signal-cli -u USERNAME updateGroup -n "Group name" -m [MEMBER [MEMBER ...]]
384
385 Add member to a group::
386 signal-cli -u USERNAME updateGroup -g GROUP_ID -m "NEW_MEMBER"
387
388 Leave a group::
389 signal-cli -u USERNAME quitGroup -g GROUP_ID
390
391 Send a message to a group::
392 signal-cli -u USERNAME send -m "This is a message" -g GROUP_ID
393
394 Trust new key, after having verified it::
395 signal-cli -u USERNAME trust -v SAFETY_NUMBER NUMBER
396
397 Trust new key, without having verified it. Only use this if you don't care about security::
398 signal-cli -u USERNAME trust -a NUMBER
399
400 == Exit codes
401 * *1*: Error is probably caused and fixable by the user
402 * *2*: Some unexpected error
403 * *3*: Server or IO error
404
405 == Files
406
407 The password and cryptographic keys are created when registering and stored in the current users home directory, the directory can be changed with *--config*:
408
409 `$XDG_DATA_HOME/signal-cli/` (`$HOME/.local/share/signal-cli/`)
410
411 For legacy users, the old config directories are used as a fallback:
412
413 $HOME/.config/signal/
414
415 $HOME/.config/textsecure/
416
417 == Authors
418
419 Maintained by AsamK <asamk@gmx.de>, who is assisted by other open source contributors.
420 For more information about signal-cli development, see
421 <https://github.com/AsamK/signal-cli>.