]> nmode's Git Repositories - signal-cli/blob - README.md
Adapt register command to reactivate account if possible
[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 linked 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 ([man page](https://github.com/AsamK/signal-cli/blob/master/man/signal-cli-dbus.5.adoc)), that can be used to send messages from any programming language that has dbus bindings.
7 It also has a JSON-RPC based interface, see the [documentation](https://github.com/AsamK/signal-cli/wiki/JSON-RPC-service) for more information.
8
9 ## Installation
10
11 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.
12
13 System requirements:
14 - at least Java Runtime Environment (JRE) 17
15 - native libraries: libzkgroup, libsignal-client
16
17 Those are bundled for x86_64 Linux (with recent enough glibc, see #643), for other systems/architectures see: [Provide native lib for libsignal](https://github.com/AsamK/signal-cli/wiki/Provide-native-lib-for-libsignal)
18
19 ### Install system-wide on Linux
20 See [latest version](https://github.com/AsamK/signal-cli/releases).
21 ```sh
22 export VERSION=<latest version, format "x.y.z">
23 wget https://github.com/AsamK/signal-cli/releases/download/v"${VERSION}"/signal-cli-"${VERSION}".tar.gz
24 sudo tar xf signal-cli-"${VERSION}".tar.gz -C /opt
25 sudo ln -sf /opt/signal-cli-"${VERSION}"/bin/signal-cli /usr/local/bin/
26 ```
27 You can find further instructions on the Wiki:
28 - [Quickstart](https://github.com/AsamK/signal-cli/wiki/Quickstart)
29 - [DBus Service](https://github.com/AsamK/signal-cli/wiki/DBus-service)
30
31 ## Usage
32
33 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).
34
35 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.)
36
37 * Register a number (with SMS verification)
38
39 signal-cli -u USERNAME register
40
41 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.
42
43 Registering may require solving a CAPTCHA challenge: [Registration with captcha](https://github.com/AsamK/signal-cli/wiki/Registration-with-captcha)
44
45 * 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
46
47 signal-cli -u USERNAME verify CODE
48
49 * Send a message
50
51 signal-cli -u USERNAME send -m "This is a message" RECIPIENT
52
53 * Pipe the message content from another process.
54
55 uname -a | signal-cli -u USERNAME send RECIPIENT
56
57 * Receive messages
58
59 signal-cli -u USERNAME receive
60
61 **Hint**: The Signal protocol expects that incoming messages are regularly received (using `daemon` or `receive` command).
62 This is required for the encryption to work efficiently and for getting updates to groups, expiration timer and other features.
63
64 ## Storage
65
66 The password and cryptographic keys are created when registering and stored in the current users home directory:
67
68 $XDG_DATA_HOME/signal-cli/data/
69 $HOME/.local/share/signal-cli/data/
70
71 ## Building
72
73 This project uses [Gradle](http://gradle.org) for building and maintaining
74 dependencies. If you have a recent gradle version installed, you can replace `./gradlew` with `gradle` in the following steps.
75
76 1. Checkout the source somewhere on your filesystem with
77
78 git clone https://github.com/AsamK/signal-cli.git
79
80 2. Execute Gradle:
81
82 ./gradlew build
83
84 2a. Create shell wrapper in *build/install/signal-cli/bin*:
85
86 ./gradlew installDist
87
88 2b. Create tar file in *build/distributions*:
89
90 ./gradlew distTar
91
92 2c. Create a fat tar file in *build/libs/signal-cli-fat*:
93
94 ./gradlew fatJar
95
96 2d. Compile and run signal-cli:
97
98 ./gradlew run --args="--help"
99
100 ### Building a native binary with GraalVM (EXPERIMENTAL)
101
102 It is possible to build a native binary with [GraalVM](https://www.graalvm.org).
103 This is still experimental and will not work in all situations.
104
105 1. [Install GraalVM and setup the enviroment](https://www.graalvm.org/docs/getting-started/#install-graalvm)
106 2. [Install prerequisites](https://www.graalvm.org/reference-manual/native-image/#prerequisites)
107 3. Execute Gradle:
108
109 ./gradlew nativeCompile
110
111 The binary is available at *build/native/nativeCompile/signal-cli*
112
113 ## FAQ and Troubleshooting
114 For frequently asked questions and issues have a look at the [wiki](https://github.com/AsamK/signal-cli/wiki/FAQ)
115
116 ## License
117
118 This project uses libsignal-service-java from Open Whisper Systems:
119
120 https://github.com/WhisperSystems/libsignal-service-java
121
122 Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html