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