]> nmode's Git Repositories - signal-cli/blob - README.md
Reformat code
[signal-cli] / README.md
1 # signal-cli
2
3 signal-cli is a commandline interface for [libsignal-service-java](https://github.com/WhisperSystems/libsignal-service-java). It supports registering, verifying, sending and receiving messages.
4 To be able to link to an existing Signal-Android/signal-cli instance, signal-cli uses a [patched libsignal-service-java](https://github.com/AsamK/libsignal-service-java), because libsignal-service-java does not yet support [provisioning as a slave device](https://github.com/WhisperSystems/libsignal-service-java/pull/21).
5 For registering you need a phone number where you can receive SMS or incoming calls.
6 signal-cli is primarily intended to be used on servers to notify admins of important events. For this use-case, it has a dbus interface, that can be used to send messages from any programming language that has dbus bindings.
7
8 ## Installation
9
10 You can [build signal-cli](#building) yourself, or use the [provided binary files](https://github.com/AsamK/signal-cli/releases/latest), which should work on Linux, macOS and Windows. For Arch Linux there is also a [package in AUR](https://aur.archlinux.org/packages/signal-cli/) and there is a [FreeBSD port](https://www.freshports.org/net-im/signal-cli) available as well.
11
12 System requirements:
13 - at least Java Runtime Environment (JRE) 11
14 - native libraries: libzkgroup, libsignal-client
15 Those are bundled for x86_64 Linux, for other systems/architectures see: [Provide native lib for libsignal](https://github.com/AsamK/signal-cli/wiki/Provide-native-lib-for-libsignal)
16
17 ### Install system-wide on Linux
18 See [latest version](https://github.com/AsamK/signal-cli/releases).
19 ```sh
20 export VERSION=<latest version, format "x.y.z">
21 wget https://github.com/AsamK/signal-cli/releases/download/v"${VERSION}"/signal-cli-"${VERSION}".tar.gz
22 sudo tar xf signal-cli-"${VERSION}".tar.gz -C /opt
23 sudo ln -sf /opt/signal-cli-"${VERSION}"/bin/signal-cli /usr/local/bin/
24 ```
25 You can find further instructions on the Wiki:
26 - [Quickstart](https://github.com/AsamK/signal-cli/wiki/Quickstart)
27 - [DBus Service](https://github.com/AsamK/signal-cli/wiki/DBus-service)
28
29 ## Usage
30
31 For a complete usage overview please read the [man page](https://github.com/AsamK/signal-cli/blob/master/man/signal-cli.1.adoc) and the [wiki](https://github.com/AsamK/signal-cli/wiki).
32
33 Important: The USERNAME is your phone number in international format and must include the country calling code. Hence it should start with a "+" sign. (See [Wikipedia](https://en.wikipedia.org/wiki/List_of_country_calling_codes) for a list of all country codes.)
34
35 * Register a number (with SMS verification)
36
37 signal-cli -u USERNAME register
38
39 You can register Signal using a land line number. In this case you can skip SMS verification process and jump directly to the voice call verification by adding the --voice switch at the end of above register command.
40
41 * Verify the number using the code received via SMS or voice, optionally add `--pin PIN_CODE` if you've added a pin code to your account
42
43 signal-cli -u USERNAME verify CODE
44
45 * Send a message
46
47 signal-cli -u USERNAME send -m "This is a message" RECIPIENT
48
49 * Pipe the message content from another process.
50
51 uname -a | signal-cli -u USERNAME send RECIPIENT
52
53 * Receive messages
54
55 signal-cli -u USERNAME receive
56
57
58 ## Storage
59
60 The password and cryptographic keys are created when registering and stored in the current users home directory:
61
62 `$XDG_DATA_HOME/signal-cli/data/` (`$HOME/.local/share/signal-cli/data/`)
63
64 For legacy users, the old config directories are used as a fallback:
65
66 $HOME/.config/signal/data/
67
68 $HOME/.config/textsecure/data/
69
70 ## Building
71
72 This project uses [Gradle](http://gradle.org) for building and maintaining
73 dependencies. If you have a recent gradle version installed, you can replace `./gradlew` with `gradle` in the following steps.
74
75 1. Checkout the source somewhere on your filesystem with
76
77 git clone https://github.com/AsamK/signal-cli.git
78
79 2. Execute Gradle:
80
81 ./gradlew build
82
83 3. Create shell wrapper in *build/install/signal-cli/bin*:
84
85 ./gradlew installDist
86
87 4. Create tar file in *build/distributions*:
88
89 ./gradlew distTar
90
91 ### Building a native binary with GraalVM (EXPERIMENTAL)
92
93 It is possible to build a native binary with [GraalVM](https://www.graalvm.org).
94 This is still experimental and will not work in all situations.
95
96 1. [Install GraalVM and setup the enviroment](https://www.graalvm.org/docs/getting-started/#install-graalvm)
97 2. [Install prerequisites](https://www.graalvm.org/reference-manual/native-image/#prerequisites)
98 3. Execute Gradle:
99
100 ./gradlew assembleNativeImage
101
102 The binary is available at *build/native-image/signal-cli*
103
104 ## Troubleshooting
105 If you use a version of the Oracle JRE and get an InvalidKeyException you need to enable unlimited strength crypto. See https://stackoverflow.com/questions/6481627/java-security-illegal-key-size-or-default-parameters for instructions.
106
107 ## License
108
109 This project uses libsignal-service-java from Open Whisper Systems:
110
111 https://github.com/WhisperSystems/libsignal-service-java
112
113 Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html