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