]> nmode's Git Repositories - signal-cli/blob - README.md
Add http endpoint events with SSE
[signal-cli] / README.md
1 # signal-cli
2
3 signal-cli is a commandline interface
4 for [libsignal-service-java](https://github.com/WhisperSystems/libsignal-service-java). It supports registering,
5 verifying, sending and receiving messages. To be able to link to an existing Signal-Android/signal-cli instance,
6 signal-cli uses a [patched libsignal-service-java](https://github.com/AsamK/libsignal-service-java), because
7 libsignal-service-java does not yet
8 support [provisioning as a linked device](https://github.com/WhisperSystems/libsignal-service-java/pull/21). For
9 registering you need a phone number where you can receive SMS or incoming calls.
10
11 signal-cli is primarily intended to be used on servers to notify admins of important events. For this use-case, it has a daemon mode with D-BUS
12 interface ([man page](https://github.com/AsamK/signal-cli/blob/master/man/signal-cli-dbus.5.adoc)) and JSON-RPC interface ([documentation](https://github.com/AsamK/signal-cli/wiki/JSON-RPC-service)). For the JSON-RPC interface there's also a simple [example client](https://github.com/AsamK/signal-cli/tree/master/client), written in Rust.
13
14 ## Installation
15
16 You can [build signal-cli](#building) yourself or use
17 the [provided binary files](https://github.com/AsamK/signal-cli/releases/latest), which should work on Linux, macOS and
18 Windows. There's also a [docker image and some Linux packages](https://github.com/AsamK/signal-cli/wiki/Binary-distributions) provided by the community.
19
20 System requirements:
21
22 - at least Java Runtime Environment (JRE) 17
23 - native library: libsignal-client
24
25 The native libs are bundled for x86_64 Linux (with recent enough glibc), Windows and MacOS. For other
26 systems/architectures
27 see: [Provide native lib for libsignal](https://github.com/AsamK/signal-cli/wiki/Provide-native-lib-for-libsignal)
28
29 ### Install system-wide on Linux
30
31 See [latest version](https://github.com/AsamK/signal-cli/releases).
32
33 ```sh
34 export VERSION=<latest version, format "x.y.z">
35 wget https://github.com/AsamK/signal-cli/releases/download/v"${VERSION}"/signal-cli-"${VERSION}"-Linux.tar.gz
36 sudo tar xf signal-cli-"${VERSION}"-Linux.tar.gz -C /opt
37 sudo ln -sf /opt/signal-cli-"${VERSION}"/bin/signal-cli /usr/local/bin/
38 ```
39
40 You can find further instructions on the Wiki:
41
42 - [Quickstart](https://github.com/AsamK/signal-cli/wiki/Quickstart)
43 - [DBus Service](https://github.com/AsamK/signal-cli/wiki/DBus-service)
44
45 ## Usage
46
47 For a complete usage overview please read
48 the [man page](https://github.com/AsamK/signal-cli/blob/master/man/signal-cli.1.adoc) and
49 the [wiki](https://github.com/AsamK/signal-cli/wiki).
50
51 Important: The ACCOUNT is your phone number in international format and must include the country calling code. Hence it
52 should start with a "+" sign. (See [Wikipedia](https://en.wikipedia.org/wiki/List_of_country_calling_codes) for a list
53 of all country codes.)
54
55 * Register a number (with SMS verification)
56
57 signal-cli -a ACCOUNT register
58
59 You can register Signal using a land line number. In this case you can skip SMS verification process and jump directly
60 to the voice call verification by adding the `--voice` switch at the end of above register command.
61
62 Registering may require solving a CAPTCHA
63 challenge: [Registration with captcha](https://github.com/AsamK/signal-cli/wiki/Registration-with-captcha)
64
65 * Verify the number using the code received via SMS or voice, optionally add `--pin PIN_CODE` if you've added a pin code
66 to your account
67
68 signal-cli -a ACCOUNT verify CODE
69
70 * Send a message
71
72 signal-cli -a ACCOUNT send -m "This is a message" RECIPIENT
73
74 * Pipe the message content from another process.
75
76 uname -a | signal-cli -a ACCOUNT send --message-from-stdin RECIPIENT
77
78 * Receive messages
79
80 signal-cli -a ACCOUNT receive
81
82 **Hint**: The Signal protocol expects that incoming messages are regularly received (using `daemon` or `receive`
83 command). This is required for the encryption to work efficiently and for getting updates to groups, expiration timer
84 and other features.
85
86 ## Storage
87
88 The password and cryptographic keys are created when registering and stored in the current users home directory:
89
90 $XDG_DATA_HOME/signal-cli/data/
91 $HOME/.local/share/signal-cli/data/
92
93 ## Building
94
95 This project uses [Gradle](http://gradle.org) for building and maintaining dependencies. If you have a recent gradle
96 version installed, you can replace `./gradlew` with `gradle` in the following steps.
97
98 1. Checkout the source somewhere on your filesystem with
99
100 git clone https://github.com/AsamK/signal-cli.git
101
102 2. Execute Gradle:
103
104 ./gradlew build
105
106 2a. Create shell wrapper in *build/install/signal-cli/bin*:
107
108 ./gradlew installDist
109
110 2b. Create tar file in *build/distributions*:
111
112 ./gradlew distTar
113
114 2c. Create a fat tar file in *build/libs/signal-cli-fat*:
115
116 ./gradlew fatJar
117
118 2d. Compile and run signal-cli:
119
120 ./gradlew run --args="--help"
121
122 ### Building a native binary with GraalVM (EXPERIMENTAL)
123
124 It is possible to build a native binary with [GraalVM](https://www.graalvm.org). This is still experimental and will not
125 work in all situations.
126
127 1. [Install GraalVM and setup the enviroment](https://www.graalvm.org/docs/getting-started/#install-graalvm)
128 2. [Install prerequisites](https://www.graalvm.org/reference-manual/native-image/#prerequisites)
129 3. Execute Gradle:
130
131 ./gradlew nativeCompile
132
133 The binary is available at *build/native/nativeCompile/signal-cli*
134
135 ## FAQ and Troubleshooting
136
137 For frequently asked questions and issues have a look at the [wiki](https://github.com/AsamK/signal-cli/wiki/FAQ)
138
139 ## License
140
141 This project uses libsignal-service-java from Open Whisper Systems:
142
143 https://github.com/WhisperSystems/libsignal-service-java
144
145 Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html