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