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