2 vim:set ts=4 sw=4 tw=82 noet:
12 signal-cli - A commandline interface for the Signal messenger
16 *signal-cli* [--config CONFIG] [-h | -v | -a ACCOUNT | --dbus | --dbus-system] command [command-options]
20 signal-cli is a commandline interface for libsignal-service-java.
21 It supports registering, verifying, sending and receiving messages.
22 For registering you need a phone number where you can receive SMS or incoming calls.
23 signal-cli was primarily developed to be used on servers to notify admins of important events.
24 For this use-case, it has a dbus and a JSON-RPC interface, that can be used to send messages from other programs.
26 For some functionality the Signal protocol requires that all messages have been received from the server.
27 The `receive` command should be regularly executed.
28 In daemon mode messages are by default continuously received.
33 Show help message and quit.
36 Print the version and quit.
39 Raise log level and include lib signal logs.
41 *--log-file* LOG_FILE::
42 Write log output to the given file.
43 If `--verbose` is also given, the detailed logs will only be written to the log file.
46 Scrub possibly sensitive information from the log, like phone numbers and UUIDs.
49 Set the path, where to store the config.
50 Make sure you have full read/write access to the given directory.
51 (Default: `$XDG_DATA_HOME/signal-cli` (`$HOME/.local/share/signal-cli`))
53 *-a* ACCOUNT, *--account* ACCOUNT::
54 Specify your phone number, that will be your identifier.
55 The phone number must include the country calling code, i.e. the number must start with a "+" sign.
57 This flag must not be given for the `link` command.
58 It is optional for the `daemon` command.
59 For all other commands it is only optional if there is exactly one local user in the config directory.
61 *--service-environment* ENVIRONMENT::
62 Choose the server environment to use:
68 Make request via user dbus.
71 Make request via system dbus.
73 *-o* OUTPUT-MODE, *--output* OUTPUT-MODE::
74 Specify if you want commands to output in either "plain-text" mode or in "json".
75 Defaults to "plain-text"
77 *--trust-new-identities* TRUST-MODE::
78 Choose when to trust new identities:
79 - `on-first-use` (default): Trust the first seen identity key from new users, changed keys must be verified manually
80 - `always`: Trust any new identity key without verification
81 - `never`: Don't trust any unknown identity key, every key must be verified manually
83 *--disable-send-log*::
84 Disable message send log (for resending messages that recipient couldn't decrypt).
90 Register a phone number with SMS or voice verification.
91 Use the verify command to complete the verification.
93 If the account is just deactivated, the register command will just reactivate account, without requiring an SMS verification.
94 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.
95 If the account was deleted (with --delete-account) it cannot be reactivated.
98 The verification should be done over voice, not SMS.
99 Voice verification only works if an SMS verification has been attempted before.
102 The captcha token, required if registration failed with a captcha required error.
103 To get the token, go to https://signalcaptchas.org/registration/generate.html
104 For the staging environment, use: https://signalcaptchas.org/staging/registration/generate.html
105 After solving the captcha, right-click on the "Open Signal" link and copy the link.
109 Verify the number using the code received via SMS or voice.
112 The verification code.
114 *-p* PIN, *--pin* PIN::
115 The registration lock PIN, that was set by the user.
116 Only required if a PIN was set.
120 Disable push support for this device, i.e. this device won't receive any more messages.
121 If this is the primary device, other users can't send messages to this number anymore.
122 Use "updateAccount" to undo this.
123 To remove a linked device, use "removeDevice" from the primary device.
126 Delete account completely from server.
127 Cannot be undone without loss.
128 You will have to be readded to each group.
130 CAUTION: Only delete your account if you won't use this number again!
132 === deleteLocalAccountData
134 Delete all local data for this account.
135 Data should only be deleted if the account is unregistered.
137 CAUTION: This cannot be undone.
139 *--ignore-registered*::
140 Delete the account data even though the account is still registered on the Signal servers.
144 Update the account attributes on the signal server.
145 Can fix problems with receiving messages.
147 *-n* NAME, *--device-name* NAME::
148 Set a new device name for the primary or linked device
150 *--unrestricted-unidentified-sender* {true,false}::
151 Enable if anyone should be able to send you unidentified sender messages.
153 === startChangeNumber
155 Change an account to a new phone number with SMS or voice verification.
156 Use the finishChangeNumber command to complete the verification.
159 The new phone number.
162 The verification should be done over voice, not SMS.
163 Voice verification only works if an SMS verification has been attempted before.
166 The captcha token, required if registration failed with a captcha required error.
167 To get the token, go to https://signalcaptchas.org/registration/generate.html
168 For the staging environment, use: https://signalcaptchas.org/staging/registration/generate.html
169 After solving the captcha, right-click on the "Open Signal" link and copy the link.
171 === finishChangeNumber
173 Verify the number using the code received via SMS or voice.
176 The new phone number.
178 *-v*, *--verification-code*::
179 The verification code.
181 *-p* PIN, *--pin* PIN::
182 The registration lock PIN, that was set by the user.
183 Only required if a PIN was set.
185 === updateConfiguration
187 Update signal configs and sync them to linked devices.
188 This command only works on the primary devices.
190 *--read-receipts* {true,false}::
191 Indicates if Signal should send read receipts.
193 *--unidentified-delivery-indicators* {true,false}::
194 Indicates if Signal should show unidentified delivery indicators.
196 *--typing-indicators* {true,false}::
197 Indicates if Signal should send/show typing indicators.
199 *--link-previews* {true,false}::
200 Indicates if Signal should generate link previews.
204 Set a registration lock pin, to prevent others from registering this number.
206 REGISTRATION_LOCK_PIN::
207 The registration lock PIN, that will be required for new registrations (resets after 7 days of inactivity)
211 Remove the registration lock pin.
215 Link to an existing device, instead of registering a new number.
216 This shows a "sgnl://linkdevice?uuid=..." URI.
217 If you want to connect to another signal-cli instance, you can just use this URI.
218 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.
220 *-n* NAME, *--name* NAME::
221 Optionally specify a name to describe this new device.
222 By default "cli" will be used.
226 Link another device to this device.
227 Only works, if this is the primary device.
230 Specify the uri contained in the QR code shown by the new device.
231 You will need the full URI such as "sgnl://linkdevice?uuid=..." (formerly "tsdevice:/?uuid=...") Make sure to enclose it in quotation marks for shells.
235 Show a list of linked devices.
239 Remove a linked device.
240 Only works, if this is the primary device.
242 *-d* DEVICE_ID, *--device-id* DEVICE_ID::
243 Specify the device you want to remove.
244 Use listDevices to see the deviceIds.
248 Uses a list of phone numbers to determine the statuses of those users.
249 Shows if they are registered on the Signal Servers or not.
250 In json mode this is outputted as a list of objects.
252 [NUMBER [NUMBER ...]]::
253 One or more numbers to check.
257 Send a message to another user or group.
260 Specify the recipients’ phone number.
263 Send the message to self without notification.
265 *-g* GROUP, *--group-id* GROUP::
266 Specify the recipient group ID in base64 encoding.
268 *-m* MESSAGE, *--message* MESSAGE::
271 *--message-from-stdin*::
272 Read the message from standard input.
274 *-a* [ATTACHMENT [ATTACHMENT ...]], *--attachment* [ATTACHMENT [ATTACHMENT ...]]::
275 Add one or more files as attachment.
276 Can be either a file path or a data URI.
277 Data URI encoded attachments must follow the RFC 2397.
278 Additionally a file name can be added:
279 e.g.: `data:<MIME-TYPE>;filename=<FILENAME>;base64,<BASE64 ENCODED DATA>`
281 *--sticker* STICKER::
282 Send a sticker of a locally known sticker pack (syntax: stickerPackId:stickerId).
283 Shouldn't be used together with `-m` as the official clients don't support this.
284 e.g.: `--sticker 00abac3bc18d7f599bff2325dc306d43:2`
287 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.
288 e.g.: `-m "Hi X!" --mention "3:1:+123456789"`
291 Style parts of the message text (syntax: start:length:STYLE).
292 Where STYLE is one of: BOLD, ITALIC, SPOILER, STRIKETHROUGH, MONOSPACE
294 e.g.: `-m "Something BIG!" --text-style "10:3:BOLD"` or for a mixed text style `-m "Something BIG!" --text-style "0:9:ITALIC" "10:3:BOLD"`
296 *--quote-timestamp*::
297 Specify the timestamp of a previous message with the recipient or group to add a quote to the new message.
300 Specify the number of the author of the original message.
303 Specify the message of the original message.
306 Specify the mentions of the original message (same format as `--mention`).
308 *--quote-text-style*::
309 Style parts of the original message text (same format as `--text-style`).
311 *--quote-attachment*::
312 Specify the attachments of the original message (syntax: contentType[:filename[:previewFile]]), e.g. 'audio/aac' or 'image/png:test.png:/tmp/preview.jpg'.
315 Specify the url for the link preview.
316 The same url must also appear in the message body, otherwise the preview won't be displayed by the apps.
319 Specify the title for the link preview (mandatory).
321 *--preview-description*::
322 Specify the description for the link preview (optional).
325 Specify the image file for the link preview (optional).
327 *--story-timestamp*::
328 Specify the timestamp of a story to reply to.
331 Specify the number of the author of the story.
333 *-e*, *--end-session*::
334 Clear session state and send end session message.
337 Specify the timestamp of a previous message with the recipient or group to send an edited message.
339 === sendPaymentNotification
341 Send a payment notification.
344 Specify the recipient’s phone number.
346 *--receipt* RECEIPT::
347 The base64 encoded receipt blob.
350 Specify a note for the payment notification.
354 Send reaction to a previously received or sent message.
357 Specify the recipients’ phone number.
359 *-g* GROUP, *--group-id* GROUP::
360 Specify the recipient group ID in base64 encoding.
362 *-e* EMOJI, *--emoji* EMOJI::
363 Specify the emoji, should be a single unicode grapheme cluster.
365 *-a* NUMBER, *--target-author* NUMBER::
366 Specify the number of the author of the message to which to react.
368 *-t* TIMESTAMP, *--target-timestamp* TIMESTAMP::
369 Specify the timestamp of the message to which to react.
375 React to a story instead of a normal message
379 Send a read or viewed receipt to a previously received message.
382 Specify the sender’s phone number.
384 *-t* TIMESTAMP, *--target-timestamp* TIMESTAMP::
385 Specify the timestamp of the message to which to react.
388 Specify the receipt type, either `read` (the default) or `viewed`.
392 Send typing message to trigger a typing indicator for the recipient.
393 Indicator will be shown for 15seconds unless a typing STOP message is sent first.
396 Specify the recipients’ phone number.
398 *-g* GROUP, *--group-id* GROUP::
399 Specify the recipient group ID in base64 encoding.
402 Send a typing STOP message.
406 Remotely delete a previously sent message.
409 Specify the recipients’ phone number.
411 *-g* GROUP, *--group-id* GROUP::
412 Specify the recipient group ID in base64 encoding.
414 *-t* TIMESTAMP, *--target-timestamp* TIMESTAMP::
415 Specify the timestamp of the message to delete.
419 Query the server for new messages.
420 New messages are printed on standard output and attachments are downloaded to the config directory.
421 In json mode this is outputted as one json object per line.
423 *-t* TIMEOUT, *--timeout* TIMEOUT::
424 Number of seconds to wait for new messages (negative values disable timeout).
425 Default is 5 seconds.
428 Maximum number of messages to receive, before returning.
430 *--ignore-attachments*::
431 Don’t download attachments of received messages.
434 Don’t receive story messages from the server.
437 *--send-read-receipts*::
438 Send read receipts for all incoming data messages (in addition to the default delivery receipts)
442 Join a group via an invitation link.
445 The invitation link URI (starts with `https://signal.group/#`)
449 Create or update a group.
450 If the user is a pending member, this command will accept the group invitation.
452 *-g* GROUP, *--group-id* GROUP::
453 Specify the recipient group ID in base64 encoding.
454 If not specified, a new group with a new random ID is generated.
456 *-n* NAME, *--name* NAME::
457 Specify the new group name.
459 *-d* DESCRIPTION, *--description* DESCRIPTION::
460 Specify the new group description.
462 *-a* AVATAR, *--avatar* AVATAR::
463 Specify a new group avatar image file.
465 *-m* [MEMBER [MEMBER ...]], *--member* [MEMBER [MEMBER ...]]::
466 Specify one or more members to add to the group.
468 *-r* [MEMBER [MEMBER ...]], *--remove-member* [MEMBER [MEMBER ...]]::
469 Specify one or more members to remove from the group
471 *--admin* [MEMBER [MEMBER ...]]::
472 Specify one or more members to make a group admin
474 *--remove-admin* [MEMBER [MEMBER ...]]::
475 Specify one or more members to remove group admin privileges
477 *--ban* [MEMBER [MEMBER ...]]::
478 Specify one or more members to ban from joining the group.
479 Banned members cannot join or request to join via a group link.
481 *--unban* [MEMBER [MEMBER ...]]::
482 Specify one or more members to remove from the ban list
485 Reset group link and create new link password
487 *--link* LINK_STATE::
488 Set group link state: `enabled`, `enabled-with-approval`, `disabled`
490 *--set-permission-add-member* PERMISSION::
491 Set permission to add new group members: `every-member`, `only-admins`
493 *--set-permission-edit-details* PERMISSION::
494 Set permission to edit group details: `every-member`, `only-admins`
496 *--set-permission-send-messages* PERMISSION::
497 Set permission to send messages in group: `every-member`, `only-admins`
498 Groups where only admins can send messages are also called announcement groups
500 *-e* EXPIRATION_SECONDS, *--expiration* EXPIRATION_SECONDS::
501 Set expiration time of messages (seconds).
502 To disable expiration set expiration time to 0.
506 Send a quit group message to all group members and remove self from member list.
507 If the user is a pending member, this command will decline the group invitation.
509 *-g* GROUP, *--group-id* GROUP::
510 Specify the recipient group ID in base64 encoding.
513 Delete local group data completely after quitting group.
517 Show a list of known groups and related information.
518 In json mode this is outputted as an list of objects and is always in detailed mode.
521 Include the list of members of each group and the group invite link.
524 Filter the group list by one or more group IDs.
528 Show a list of known contacts with names and profiles.
529 When a specific recipient is given, its profile will be refreshed.
532 Specify the recipients’ phone number.
534 *-a*, *--all-recipients*::
535 Include all known recipients, not only contacts.
538 Specify if only blocked or unblocked contacts should be shown (default: all contacts)
541 Find contacts with the given contact or profile name.
545 List all known identity keys and their trust status, fingerprint and safety number.
547 *-n* NUMBER, *--number* NUMBER::
548 Only show identity keys for the given phone number.
552 Set the trust level of a given number.
553 The first time a key for a number is seen, it is trusted by default (TOFU).
554 If the key changes, the new key must be trusted manually.
557 Specify the phone number, for which to set the trust.
559 *-a*, *--trust-all-known-keys*::
560 Trust all known keys of this user, only use this for testing.
562 *-v* VERIFIED_SAFETY_NUMBER, *--verified-safety-number* VERIFIED_SAFETY_NUMBER::
563 Specify the safety number of the key, only use this option if you have verified the safety number.
564 Can be either the plain text numbers shown in the app or the bytes from the QR-code, encoded as base64.
568 Update the profile information shown to message recipients.
569 The profile is stored encrypted on the Signal servers.
570 The decryption key is sent with every outgoing messages to contacts and included in every group.
572 *--given-name* NAME, *--name* NAME::
575 *--family-name* FAMILY_NAME::
578 *--about* ABOUT_TEXT::
579 New profile status text.
581 *--about-emoji* EMOJI::
582 New profile status emoji.
584 *--avatar* AVATAR_FILE::
585 Path to the new avatar image file.
590 *--mobile-coin-address*::
591 New MobileCoin address (Base64 encoded public address)
595 Update the info associated to a number on our contact list.
596 This change is only local but can be synchronized to other devices by using `sendContacts` (see below).
597 If the contact doesn't exist yet, it will be added.
600 Specify the contact phone number.
602 *--given-name* NAME, *--name* NAME::
605 *--family-name* FAMILY_NAME::
608 *-e*, *--expiration* EXPIRATION_SECONDS::
609 Set expiration time of messages (seconds).
610 To disable expiration set expiration time to 0.
614 Remove the info of a given contact
617 Specify the contact phone number.
620 Hide the contact in the contact list, but keep the data.
623 Delete all data associated with this contact, including identity keys and sessions.
627 Block the given contacts or groups (no messages will be received).
628 This change is only local but can be synchronized to other devices by using `sendContacts` (see below).
630 [CONTACT [CONTACT ...]]::
631 Specify the phone numbers of contacts that should be blocked.
633 *-g* [GROUP [GROUP ...]], *--group-id* [GROUP [GROUP ...]]::
634 Specify the group IDs that should be blocked in base64 encoding.
638 Unblock the given contacts or groups (messages will be received again).
639 This change is only local but can be synchronized to other devices by using `sendContacts` (see below).
641 [CONTACT [CONTACT ...]]::
642 Specify the phone numbers of contacts that should be unblocked.
644 *-g* [GROUP [GROUP ...]], *--group-id* [GROUP [GROUP ...]]::
645 Specify the group IDs that should be unblocked in base64 encoding.
649 Send a synchronization message with the local contacts list to all linked devices.
650 This command should only be used if this is the primary device.
654 Send a synchronization request message to the primary device (for group, contacts, ...).
655 The primary device will respond with synchronization messages with full contact and group lists.
657 === uploadStickerPack
659 Upload a new sticker pack, consisting of a manifest file and the sticker images. +
660 Images must conform to the following specification: (see https://support.signal.org/hc/en-us/articles/360031836512-Stickers#sticker_reqs )
662 - Static stickers in PNG or WebP format
663 - Animated stickers in APNG format,
664 - Maximum file size for a sticker file is 300KiB
665 - Image resolution of 512 x 512 px
667 The required manifest.json has the following format:
672 "title": "<STICKER_PACK_TITLE>",
673 "author": "<STICKER_PACK_AUTHOR>",
674 "cover": { // Optional cover, by default the first sticker is used as cover
675 "file": "<name of image file, mandatory>",
676 "contentType": "<optional>",
677 "emoji": "<optional>"
681 "file": "<name of image file, mandatory>",
682 "contentType": "<optional>",
683 "emoji": "<optional>"
691 The path of the manifest.json or a zip file containing the sticker pack you wish to upload.
695 Show a list of known sticker packs.
699 Install a sticker pack for this account.
702 Specify the uri of the sticker pack.
703 e.g. https://signal.art/addstickers/#pack_id=XXX&pack_key=XXX)"
707 Gets the raw data for a specified attachment.
708 This is done using the ID of the attachment the recipient or group ID.
709 The attachment data is returned as a Base64 String.
712 The ID of the attachment as given in the attachment list of the message.
714 *--recipient* [RECIPIENT]::
715 Specify the number which sent the attachment.
716 Referred to generally as recipient.
718 *-g* [GROUP], *--group-id* [GROUP]::
719 Alternatively, specify the group IDs for which to get the attachment.
723 signal-cli can run in daemon mode and provides JSON-RPC or an experimental dbus interface.
724 If no `-a` account is given, all local accounts will be loaded.
725 Multiple interfaces can be used at the same time, e.g. `daemon --socket --dbus`
727 *--socket [SOCKET]*::
728 Export a JSON-RPC interface on a UNIX socket (default $XDG_RUNTIME_DIR/signal-cli/socket). +
729 See **signal-cli-jsonrpc**(5) for info on the JSON-RPC interface.
731 *--tcp [HOST:PORT]*::
732 Export a JSON-RPC interface on a TCP socket (default localhost:7583). +
733 See **signal-cli-jsonrpc**(5) for info on the JSON-RPC interface.
735 *--http [HOST:PORT]*::
736 Expose a JSON-RPC interface as http endpoint (default localhost:8080).
737 The JSON-RPC endpoint is `/api/v1/rpc`. +
738 See **signal-cli-jsonrpc**(5) for info on the JSON-RPC interface.
741 Export DBus interface on user bus. +
742 See **signal-cli-dbus**(5) for info on the dbus interface.
745 Export DBus interface on system bus. +
746 See **signal-cli-dbus**(5) for info on the dbus interface.
748 *--ignore-attachments*::
749 Don’t download attachments of received messages.
752 Don’t receive story messages from the server.
754 *--send-read-receipts*::
755 Send read receipts for all incoming data messages (in addition to the default delivery receipts)
757 *--no-receive-stdout*::
758 Don’t print received messages to stdout.
761 Specify when to start receiving messages (on-start, on-connection, manual)
765 Run in signal-cli in JSON-RPC mode.
766 Reads JSON-RPC requests on stdin and responds on stdout.
767 See **signal-cli-jsonrpc**(5) for info on the JSON-RPC interface.
769 *--ignore-attachments*::
770 Don’t download attachments of received messages.
773 Don’t receive story messages from the server.
775 *--send-read-receipts*::
776 Send read receipts for all incoming data messages (in addition to the default delivery receipts)
779 Specify when to start receiving messages (on-start, manual)
781 === submitRateLimitChallenge
783 When running into rate limits, sometimes the limit can be lifted, by solving a CAPTCHA.
784 To get the captcha token, go to https://signalcaptchas.org/challenge/generate.html
785 For the staging environment, use: https://signalcaptchas.org/staging/registration/generate.html
787 *--challenge* CHALLENGE_TOKEN::
788 The challenge token from the failed send attempt.
790 *--captcha* CAPTCHA::
791 The captcha result, starting with signalcaptcha://
795 Register a number (with SMS verification)::
796 signal-cli -a ACCOUNT register
798 Verify the number using the code received via SMS or voice::
799 signal-cli -a ACCOUNT verify CODE
801 Send a message to one or more recipients::
802 signal-cli -a ACCOUNT send -m "This is a message" [RECIPIENT [RECIPIENT ...]] [-a [ATTACHMENT [ATTACHMENT ...]]]
804 Pipe the message content from another process::
805 uname -a | signal-cli -a ACCOUNT send --message-from-stdin [RECIPIENT [RECIPIENT ...]]
808 signal-cli -a ACCOUNT updateGroup -n "Group name" -m [MEMBER [MEMBER ...]]
810 Add member to a group::
811 signal-cli -a ACCOUNT updateGroup -g GROUP_ID -m "NEW_MEMBER"
813 Accept a group invitation::
814 signal-cli -a ACCOUNT updateGroup -g GROUP_ID
817 signal-cli -a ACCOUNT quitGroup -g GROUP_ID
819 Send a message to a group::
820 signal-cli -a ACCOUNT send -m "This is a message" -g GROUP_ID
822 Trust new key, after having verified it::
823 signal-cli -a ACCOUNT trust -v SAFETY_NUMBER NUMBER
825 Trust new key, without having verified it. Only use this if you don't care about security::
826 signal-cli -a ACCOUNT trust -a NUMBER
830 * *1*: Error is probably caused and fixable by the user
831 * *2*: Some unexpected error
832 * *3*: Server or IO error
833 * *4*: Sending failed due to untrusted key
834 * *5*: Server rate limiting error
838 The password and cryptographic keys are created when registering and stored in the current users home directory, the directory can be changed with *--config*:
840 `$XDG_DATA_HOME/signal-cli/` (`$HOME/.local/share/signal-cli/`)
844 Maintained by AsamK <asamk@gmx.de>, who is assisted by other open source contributors.
845 For more information about signal-cli development, see
846 <https://github.com/AsamK/signal-cli>.