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