]> nmode's Git Repositories - signal-cli/blob - man/signal-cli.1.adoc
Refactor JsonMessageEnvelope to remove unnecessary number canonicalization
[signal-cli] / man / signal-cli.1.adoc
1 /////
2 vim:set ts=4 sw=4 tw=82 noet:
3 /////
4
5 :quotes.~:
6
7 = signal-cli (1)
8
9 == Name
10
11 signal-cli - A commandline and dbus interface for the Signal messenger
12
13 == Synopsis
14
15 *signal-cli* [--config CONFIG] [-h | -v | -a ACCOUNT | --dbus | --dbus-system] command [command-options]
16
17 == Description
18
19 signal-cli is a commandline interface for libsignal-service-java.
20 It supports registering, verifying, sending and receiving messages.
21 For registering you need a phone number where you can receive SMS or incoming calls.
22 signal-cli was primarily developed to be used on servers to notify admins of important events.
23 For this use-case, it has a dbus interface, that can be used to send messages from any programming language that has dbus bindings.
24
25 For some functionality the Signal protocol requires that all messages have been received from the server.
26 The `receive` command should be regularly executed.
27 In daemon mode messages are continuously received.
28
29 == Options
30
31 *-h*, *--help*::
32 Show help message and quit.
33
34 *-v*, *--version*::
35 Print the version and quit.
36
37 *--verbose*::
38 Raise log level and include lib signal logs.
39
40 *--log-file* LOG_FILE::
41 Write log output to the given file.
42 If `--verbose` is also given, the detailed logs will only be written to the log file.
43
44 *--config* CONFIG::
45 Set the path, where to store the config.
46 Make sure you have full read/write access to the given directory.
47 (Default: `$XDG_DATA_HOME/signal-cli` (`$HOME/.local/share/signal-cli`))
48
49 *-a* ACCOUNT, *--account* ACCOUNT::
50 Specify your phone number, that will be your identifier.
51 The phone number must include the country calling code, i.e. the number must start with a "+" sign.
52
53 This flag must not be given for the `link` command.
54 It is optional for the `daemon` command.
55 For all other commands it is only optional if there is exactly one local user in the config directory.
56
57 *--service-environment* ENVIRONMENT
58 Choose the server environment to use:
59 - `live` (default)
60 - `staging`
61
62 *--dbus*::
63 Make request via user dbus.
64
65 *--dbus-system*::
66 Make request via system dbus.
67
68 *-o* OUTPUT-MODE, *--output* OUTPUT-MODE::
69 Specify if you want commands to output in either "plain-text" mode or in "json".
70 Defaults to "plain-text"
71
72 *--trust-new-identities* TRUST-MODE::
73 Choose when to trust new identities:
74 - `on-first-use` (default): Trust the first seen identity key from new users, changed keys must be verified manually
75 - `always`: Trust any new identity key without verification
76 - `never`: Don't trust any unknown identity key, every key must be verified manually
77
78 == Commands
79
80 === register
81
82 Register a phone number with SMS or voice verification.
83 Use the verify command to complete the verification.
84
85 If the account is just deactivated, the register command will just reactivate account, without requiring an SMS verification.
86 By default the unregister command just deactivates the account, in which case it can be reactivated without sms verification if the local data is still available.
87 If the account was deleted (with --delete-account) it cannot be reactivated.
88
89 *-v*, *--voice*::
90 The verification should be done over voice, not SMS.
91
92 *--captcha*::
93 The captcha token, required if registration failed with a captcha required error.
94 To get the token, go to https://signalcaptchas.org/registration/generate.html
95 Check the developer tools for a redirect starting with signalcaptcha:// Everything after signalcaptcha:// is the captcha token.
96
97 === verify
98
99 Verify the number using the code received via SMS or voice.
100
101 VERIFICATIONCODE::
102 The verification code.
103
104 *-p* PIN, *--pin* PIN::
105 The registration lock PIN, that was set by the user.
106 Only required if a PIN was set.
107
108 === unregister
109
110 Disable push support for this device, i.e. this device won't receive any more messages.
111 If this is the master device, other users can't send messages to this number anymore.
112 Use "updateAccount" to undo this.
113 To remove a linked device, use "removeDevice" from the master device.
114
115 *--delete-account*::
116 Delete account completely from server.
117 Cannot be undone without loss.
118 You will have to be readded to each group.
119
120 CAUTION: Only delete your account if you won't use this number again!
121
122 === updateAccount
123
124 Update the account attributes on the signal server.
125 Can fix problems with receiving messages.
126
127 *-n* NAME, *--device-name* NAME::
128 Set a new device name for the main or linked device
129
130 === updateConfiguration
131
132 Update signal configs and sync them to linked devices.
133 This command only works on the main devices.
134
135 *--read-receipts* {true,false}::
136 Indicates if Signal should send read receipts.
137
138 *--unidentified-delivery-indicators* {true,false}::
139 Indicates if Signal should show unidentified delivery indicators.
140
141 *--typing-indicators* {true,false}::
142 Indicates if Signal should send/show typing indicators.
143
144 *--link-previews* {true,false}::
145 Indicates if Signal should generate link previews.
146
147 === setPin
148
149 Set a registration lock pin, to prevent others from registering this number.
150
151 REGISTRATION_LOCK_PIN::
152 The registration lock PIN, that will be required for new registrations (resets after 7 days of inactivity)
153
154 === removePin
155
156 Remove the registration lock pin.
157
158 === link
159
160 Link to an existing device, instead of registering a new number.
161 This shows a "sgnl://linkdevice?uuid=..." URI.
162 If you want to connect to another signal-cli instance, you can just use this URI.
163 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.
164
165 *-n* NAME, *--name* NAME::
166 Optionally specify a name to describe this new device.
167 By default "cli" will be used.
168
169 === addDevice
170
171 Link another device to this device.
172 Only works, if this is the master device.
173
174 *--uri* URI::
175 Specify the uri contained in the QR code shown by the new device.
176 You will need the full URI such as "sgnl://linkdevice?uuid=..." (formerly "tsdevice:/?uuid=...") Make sure to enclose it in quotation marks for shells.
177
178 === listDevices
179
180 Show a list of linked devices.
181
182 === removeDevice
183
184 Remove a linked device.
185 Only works, if this is the master device.
186
187 *-d* DEVICE_ID, *--device-id* DEVICE_ID::
188 Specify the device you want to remove.
189 Use listDevices to see the deviceIds.
190
191 === getUserStatus
192
193 Uses a list of phone numbers to determine the statuses of those users.
194 Shows if they are registered on the Signal Servers or not.
195 In json mode this is outputted as a list of objects.
196
197 [NUMBER [NUMBER ...]]::
198 One or more numbers to check.
199
200 === send
201
202 Send a message to another user or group.
203
204 RECIPIENT::
205 Specify the recipients’ phone number.
206
207 *--note-to-self*::
208 Send the message to self without notification.
209
210 *-g* GROUP, *--group-id* GROUP::
211 Specify the recipient group ID in base64 encoding.
212
213 *-m* MESSAGE, *--message* MESSAGE::
214 Specify the message, if missing, standard input is used.
215
216 *-a* [ATTACHMENT [ATTACHMENT ...]], *--attachment* [ATTACHMENT [ATTACHMENT ...]]::
217 Add one or more files as attachment.
218
219 *--sticker* STICKER::
220 Send a sticker of a locally known sticker pack (syntax: stickerPackId:stickerId).
221 Shouldn't be used together with `-m` as the official clients don't support this.
222 e.g.: `--sticker 00abac3bc18d7f599bff2325dc306d43:2`
223
224 *--mention*::
225 Mention another group member (syntax: start:length:recipientNumber) In the apps the mention replaces part of the message text, which is specified by the start and length values.
226 e.g.: `-m "Hi X!" --mention "3:1:+123456789"`
227
228 *--quote-timestamp*::
229 Specify the timestamp of a previous message with the recipient or group to add a quote to the new message.
230
231 *--quote-author*::
232 Specify the number of the author of the original message.
233
234 *--quote-message*::
235 Specify the message of the original message.
236
237 *--quote-mention*::
238 Specify the mentions of the original message (same format as `--mention`).
239
240 *-e*, *--end-session*::
241 Clear session state and send end session message.
242
243 === sendReaction
244
245 Send reaction to a previously received or sent message.
246
247 RECIPIENT::
248 Specify the recipients’ phone number.
249
250 *-g* GROUP, *--group-id* GROUP::
251 Specify the recipient group ID in base64 encoding.
252
253 *-e* EMOJI, *--emoji* EMOJI::
254 Specify the emoji, should be a single unicode grapheme cluster.
255
256 *-a* NUMBER, *--target-author* NUMBER::
257 Specify the number of the author of the message to which to react.
258
259 *-t* TIMESTAMP, *--target-timestamp* TIMESTAMP::
260 Specify the timestamp of the message to which to react.
261
262 *-r*, *--remove*::
263 Remove a reaction.
264
265 === sendReceipt
266
267 Send a read or viewed receipt to a previously received message.
268
269 RECIPIENT::
270 Specify the sender’s phone number.
271
272 *-t* TIMESTAMP, *--target-timestamp* TIMESTAMP::
273 Specify the timestamp of the message to which to react.
274
275 *--type* TYPE::
276 Specify the receipt type, either `read` (the default) or `viewed`.
277
278 === sendTyping
279
280 Send typing message to trigger a typing indicator for the recipient.
281 Indicator will be shown for 15seconds unless a typing STOP message is sent first.
282
283 RECIPIENT::
284 Specify the recipients’ phone number.
285
286 *-g* GROUP, *--group-id* GROUP::
287 Specify the recipient group ID in base64 encoding.
288
289 *-s*, *--stop*::
290 Send a typing STOP message.
291
292 === remoteDelete
293
294 Remotely delete a previously sent message.
295
296 RECIPIENT::
297 Specify the recipients’ phone number.
298
299 *-g* GROUP, *--group-id* GROUP::
300 Specify the recipient group ID in base64 encoding.
301
302 *-t* TIMESTAMP, *--target-timestamp* TIMESTAMP::
303 Specify the timestamp of the message to delete.
304
305 === receive
306
307 Query the server for new messages.
308 New messages are printed on standard output and attachments are downloaded to the config directory.
309 In json mode this is outputted as one json object per line.
310
311 *-t* TIMEOUT, *--timeout* TIMEOUT::
312 Number of seconds to wait for new messages (negative values disable timeout).
313 Default is 5 seconds.
314 *--ignore-attachments*::
315 Don’t download attachments of received messages.
316
317 === joinGroup
318
319 Join a group via an invitation link.
320
321 *--uri*::
322 The invitation link URI (starts with `https://signal.group/#`)
323
324 === updateGroup
325
326 Create or update a group.
327 If the user is a pending member, this command will accept the group invitation.
328
329 *-g* GROUP, *--group-id* GROUP::
330 Specify the recipient group ID in base64 encoding.
331 If not specified, a new group with a new random ID is generated.
332
333 *-n* NAME, *--name* NAME::
334 Specify the new group name.
335
336 *-d* DESCRIPTION, *--description* DESCRIPTION::
337 Specify the new group description.
338
339 *-a* AVATAR, *--avatar* AVATAR::
340 Specify a new group avatar image file.
341
342 *-m* [MEMBER [MEMBER ...]], *--member* [MEMBER [MEMBER ...]]::
343 Specify one or more members to add to the group.
344
345 *-r* [MEMBER [MEMBER ...]], *--remove-member* [MEMBER [MEMBER ...]]::
346 Specify one or more members to remove from the group
347
348 *--admin* [MEMBER [MEMBER ...]]::
349 Specify one or more members to make a group admin
350
351 *--remove-admin* [MEMBER [MEMBER ...]]::
352 Specify one or more members to remove group admin privileges
353
354 *--reset-link*::
355 Reset group link and create new link password
356
357 *--link* LINK_STATE::
358 Set group link state: `enabled`, `enabled-with-approval`, `disabled`
359
360 *--set-permission-add-member* PERMISSION::
361 Set permission to add new group members: `every-member`, `only-admins`
362
363 *--set-permission-edit-details* PERMISSION::
364 Set permission to edit group details: `every-member`, `only-admins`
365
366 *--set-permission-send-messages* PERMISSION::
367 Set permission to send messages in group: `every-member`, `only-admins`
368 Groups where only admins can send messages are also called announcement groups
369
370 *-e* EXPIRATION_SECONDS, *--expiration* EXPIRATION_SECONDS::
371 Set expiration time of messages (seconds).
372 To disable expiration set expiration time to 0.
373
374 === quitGroup
375
376 Send a quit group message to all group members and remove self from member list.
377 If the user is a pending member, this command will decline the group invitation.
378
379 *-g* GROUP, *--group-id* GROUP::
380 Specify the recipient group ID in base64 encoding.
381
382 *--delete*::
383 Delete local group data completely after quitting group.
384
385 === listGroups
386
387 Show a list of known groups and related information.
388 In json mode this is outputted as an list of objects and is always in detailed mode.
389
390 *-d*, *--detailed*::
391 Include the list of members of each group and the group invite link.
392
393 === listContacts
394
395 Show a list of known contacts with names.
396
397 === listIdentities
398
399 List all known identity keys and their trust status, fingerprint and safety number.
400
401 *-n* NUMBER, *--number* NUMBER::
402 Only show identity keys for the given phone number.
403
404 === trust
405
406 Set the trust level of a given number.
407 The first time a key for a number is seen, it is trusted by default (TOFU).
408 If the key changes, the new key must be trusted manually.
409
410 number::
411 Specify the phone number, for which to set the trust.
412
413 *-a*, *--trust-all-known-keys*::
414 Trust all known keys of this user, only use this for testing.
415
416 *-v* VERIFIED_SAFETY_NUMBER, *--verified-safety-number* VERIFIED_SAFETY_NUMBER::
417 Specify the safety number of the key, only use this option if you have verified the safety number.
418 Can be either the plain text numbers shown in the app or the bytes from the QR-code, encoded as base64.
419
420 === updateProfile
421
422 Update the profile information shown to message recipients.
423 The profile is stored encrypted on the Signal servers.
424 The decryption key is sent with every outgoing messages to contacts and included in every group.
425
426 *--given-name* NAME, *--name* NAME::
427 New (given) name.
428
429 *--family-name* FAMILY_NAME::
430 New family name.
431
432 *--about* ABOUT_TEXT::
433 New profile status text.
434
435 *--about-emoji* EMOJI::
436 New profile status emoji.
437
438 *--avatar* AVATAR_FILE::
439 Path to the new avatar image file.
440
441 *--remove-avatar*::
442 Remove the avatar
443
444 === updateContact
445
446 Update the info associated to a number on our contact list.
447 This change is only local but can be synchronized to other devices by using `sendContacts` (see below).
448 If the contact doesn't exist yet, it will be added.
449
450 NUMBER::
451 Specify the contact phone number.
452
453 *-n*, *--name*::
454 Specify the new name for this contact.
455
456 *-e*, *--expiration* EXPIRATION_SECONDS::
457 Set expiration time of messages (seconds).
458 To disable expiration set expiration time to 0.
459
460 === removeContact
461
462 Remove the info of a given contact
463
464 NUMBER::
465 Specify the contact phone number.
466
467 *--forget*::
468 Delete all data associated with this contact, including identity keys and sessions.
469
470 === block
471
472 Block the given contacts or groups (no messages will be received).
473 This change is only local but can be synchronized to other devices by using `sendContacts` (see below).
474
475 [CONTACT [CONTACT ...]]::
476 Specify the phone numbers of contacts that should be blocked.
477
478 *-g* [GROUP [GROUP ...]], *--group-id* [GROUP [GROUP ...]]::
479 Specify the group IDs that should be blocked in base64 encoding.
480
481 === unblock
482
483 Unblock the given contacts or groups (messages will be received again).
484 This change is only local but can be synchronized to other devices by using `sendContacts` (see below).
485
486 [CONTACT [CONTACT ...]]::
487 Specify the phone numbers of contacts that should be unblocked.
488
489 *-g* [GROUP [GROUP ...]], *--group-id* [GROUP [GROUP ...]]::
490 Specify the group IDs that should be unblocked in base64 encoding.
491
492 === sendContacts
493
494 Send a synchronization message with the local contacts list to all linked devices.
495 This command should only be used if this is the master device.
496
497 === sendSyncRequest
498
499 Send a synchronization request message to the master device (for group, contacts, ...).
500 The master device will respond with synchronization messages with full contact and group lists.
501
502 === uploadStickerPack
503
504 Upload a new sticker pack, consisting of a manifest file and the sticker images.
505 Images must conform to the following specification: (see https://support.signal.org/hc/en-us/articles/360031836512-Stickers#sticker_reqs )
506
507 - Static stickers in PNG or WebP format
508 - Animated stickers in APNG format,
509 - Maximum file size for a sticker file is 300KiB
510 - Image resolution of 512 x 512 px
511
512 The required manifest.json has the following format:
513
514 [source,json]
515 ----
516 {
517 "title": "<STICKER_PACK_TITLE>",
518 "author": "<STICKER_PACK_AUTHOR>",
519 "cover": { // Optional cover, by default the first sticker is used as cover
520 "file": "<name of image file, mandatory>",
521 "contentType": "<optional>",
522 "emoji": "<optional>"
523 },
524 "stickers": [
525 {
526 "file": "<name of image file, mandatory>",
527 "contentType": "<optional>",
528 "emoji": "<optional>"
529 }
530 ...
531 ]
532 }
533 ----
534
535 PATH::
536 The path of the manifest.json or a zip file containing the sticker pack you wish to upload.
537
538 === daemon
539
540 signal-cli can run in daemon mode and provides an experimental dbus or JSON-RPC interface.
541 If no `-a` account is given, all local accounts will be exported as separate dbus objects under the same bus name.
542
543 *--dbus*::
544 Export DBus interface on user bus.
545 See signal-cli-dbus (5) for info on the dbus interface.
546
547 *--dbus-system*::
548 Export DBus interface on system bus.
549 See signal-cli-dbus (5) for info on the dbus interface.
550
551 *--socket [SOCKET]*::
552 Export a JSON-RPC interface on a UNIX socket (default $XDG_RUNTIME_DIR/signal-cli/socket).
553 See signal-cli-jsonrpc (5) for info on the JSON-RPC interface.
554
555 *--tcp [HOST:PORT]*::
556 Export a JSON-RPC interface on a TCP socket (default localhost:7583).
557 See signal-cli-jsonrpc (5) for info on the JSON-RPC interface.
558
559 *--ignore-attachments*::
560 Don’t download attachments of received messages.
561
562 *--no-receive-stdout*::
563 Don’t print received messages to stdout.
564
565 *--receive-mode*::
566 Specify when to start receiving messages (on-start, on-connection, manual)
567
568 == Examples
569
570 Register a number (with SMS verification)::
571 signal-cli -a ACCOUNT register
572
573 Verify the number using the code received via SMS or voice::
574 signal-cli -a ACCOUNT verify CODE
575
576 Send a message to one or more recipients::
577 signal-cli -a ACCOUNT send -m "This is a message" [RECIPIENT [RECIPIENT ...]] [-a [ATTACHMENT [ATTACHMENT ...]]]
578
579 Pipe the message content from another process::
580 uname -a | signal-cli -a ACCOUNT send [RECIPIENT [RECIPIENT ...]]
581
582 Create a group::
583 signal-cli -a ACCOUNT updateGroup -n "Group name" -m [MEMBER [MEMBER ...]]
584
585 Add member to a group::
586 signal-cli -a ACCOUNT updateGroup -g GROUP_ID -m "NEW_MEMBER"
587
588 Accept a group invitation::
589 signal-cli -a ACCOUNT updateGroup -g GROUP_ID
590
591 Leave a group::
592 signal-cli -a ACCOUNT quitGroup -g GROUP_ID
593
594 Send a message to a group::
595 signal-cli -a ACCOUNT send -m "This is a message" -g GROUP_ID
596
597 Trust new key, after having verified it::
598 signal-cli -a ACCOUNT trust -v SAFETY_NUMBER NUMBER
599
600 Trust new key, without having verified it. Only use this if you don't care about security::
601 signal-cli -a ACCOUNT trust -a NUMBER
602
603 == Exit codes
604
605 * *1*: Error is probably caused and fixable by the user
606 * *2*: Some unexpected error
607 * *3*: Server or IO error
608 * *4*: Sending failed due to untrusted key
609
610 == Files
611
612 The password and cryptographic keys are created when registering and stored in the current users home directory, the directory can be changed with *--config*:
613
614 `$XDG_DATA_HOME/signal-cli/` (`$HOME/.local/share/signal-cli/`)
615
616 == Authors
617
618 Maintained by AsamK <asamk@gmx.de>, who is assisted by other open source contributors.
619 For more information about signal-cli development, see
620 <https://github.com/AsamK/signal-cli>.