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