Closes #759 commit 169bb518bf6a43bd0bf14e1291f055017a5d5937 Author: John Freed <okgithub@johnfreed.com> Date: Fri Oct 15 08:53:34 2021 +0200 remove org.asamk.signal.manager.api.Configuration commit 27ecfee382f0f1402f452a9f5fb1079b2f9c9fc5 Author: John Freed <okgithub@johnfreed.com> Date: Fri Oct 15 08:40:13 2021 +0200 add a DBus "daemon running" indicator commit 94b3d9e2ed91b002751df0e04adba3cbc79e6bd1 Author: John Freed <okgithub@johnfreed.com> Date: Fri Oct 15 08:20:03 2021 +0200 changing most DBus logger.info to logger.debug commit 15da0601272db4b907bf94240b436667870cea87 Author: John Freed <okgithub@johnfreed.com> Date: Fri Oct 15 00:09:26 2021 +0200 Configuration for Dbus and main Main program subcommand - fix logic to take into account previously unset flags - provide output in json and plain-text formats new Dbus Properties: - ConfigurationReadReceipts - ConfigurationUnidentifiedDeliveryIndicators - ConfigurationTypingIndicators - ConfigurationLinkPreviews removed getConfiguration and setConfiguration methods updated documentation commit 09da3aae62d34de33b73dc53870090c23efe078a Merge: 3c40b1118ad9fbAuthor: John Freed <okgithub@johnfreed.com> Date: Thu Oct 14 15:24:07 2021 +0200 Merge branch master into dbus_updateConfiguration commit 3c40b11b8a6a0619e92de6d54262966aee27fd5d Merge: 8416d4acadcc6cAuthor: John Freed <okgithub@johnfreed.com> Date: Sat Oct 9 14:08:08 2021 +0200 Merge branch master into dbus_updateConfiguration commit 8416d4ac475af5c512d963bf79e62e933592e20a Author: John Freed <okgithub@johnfreed.com> Date: Mon Oct 4 08:48:56 2021 +0200 Dbus get/setConfiguration methods implement: - getConfiguration() -> [readReceipts<b>, unidentifiedDeliveryIndicators<b>, typingIndicators<b>, linkPreviews<b>] -> <>:: - setConfiguration(readReceipts<b>, unidentifiedDeliveryIndicators<b>, typingIndicators<b>, linkPreviews<b>) -> <>:: Update documentation
signal-cli
signal-cli is a commandline interface for libsignal-service-java. It supports registering, verifying, sending and receiving messages. To be able to link to an existing Signal-Android/signal-cli instance, signal-cli uses a patched libsignal-service-java, because libsignal-service-java does not yet support provisioning as a linked device. For registering you need a phone number where you can receive SMS or incoming calls. 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), that can be used to send messages from any programming language that has dbus bindings. It also has a JSON-RPC based interface, see the documentation for more information.
Installation
You can build signal-cli yourself, or use the provided binary files, which should work on Linux, macOS and Windows. For Arch Linux there is also a package in AUR and there is a FreeBSD port available as well.
System requirements:
-
at least Java Runtime Environment (JRE) 17
-
native libraries: libzkgroup, libsignal-client
Those are bundled for x86_64 Linux (with recent enough glibc, see #643), for other systems/architectures see: Provide native lib for libsignal
Install system-wide on Linux
See latest version.
export VERSION=<latest version, format "x.y.z">
wget https://github.com/AsamK/signal-cli/releases/download/v"${VERSION}"/signal-cli-"${VERSION}".tar.gz
sudo tar xf signal-cli-"${VERSION}".tar.gz -C /opt
sudo ln -sf /opt/signal-cli-"${VERSION}"/bin/signal-cli /usr/local/bin/
You can find further instructions on the Wiki:
Usage
For a complete usage overview please read the man page and the wiki.
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 for a list of all country codes.)
-
Register a number (with SMS verification)
signal-cli -u USERNAME registerYou 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
--voiceswitch at the end of above register command.Registering may require solving a CAPTCHA challenge: Registration with captcha
-
Verify the number using the code received via SMS or voice, optionally add
--pin PIN_CODEif you've added a pin code to your accountsignal-cli -u USERNAME verify CODE -
Send a message
signal-cli -u USERNAME send -m "This is a message" RECIPIENT -
Pipe the message content from another process.
uname -a | signal-cli -u USERNAME send RECIPIENT -
Receive messages
signal-cli -u USERNAME receive
Hint: The Signal protocol expects that incoming messages are regularly received (using daemon or receive command).
This is required for the encryption to work efficiently and for getting updates to groups, expiration timer and other features.
Storage
The password and cryptographic keys are created when registering and stored in the current users home directory:
$XDG_DATA_HOME/signal-cli/data/
$HOME/.local/share/signal-cli/data/
Building
This project uses Gradle for building and maintaining
dependencies. If you have a recent gradle version installed, you can replace ./gradlew with gradle in the following steps.
-
Checkout the source somewhere on your filesystem with
git clone https://github.com/AsamK/signal-cli.git -
Execute Gradle:
./gradlew build2a. Create shell wrapper in build/install/signal-cli/bin:
./gradlew installDist2b. Create tar file in build/distributions:
./gradlew distTar2c. Create a fat tar file in build/libs/signal-cli-fat:
./gradlew fatJar2d. Compile and run signal-cli:
./gradlew run --args="--help"
Building a native binary with GraalVM (EXPERIMENTAL)
It is possible to build a native binary with GraalVM. This is still experimental and will not work in all situations.
-
Execute Gradle:
./gradlew nativeCompileThe binary is available at build/native/nativeCompile/signal-cli
FAQ and Troubleshooting
For frequently asked questions and issues have a look at the wiki
License
This project uses libsignal-service-java from Open Whisper Systems:
https://github.com/WhisperSystems/libsignal-service-java
Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html