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