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