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