signal-cli
A reusable Python library and CLI for sending text messages and images via signal-cli-rest-api.
It supports sending to both Signal groups and individual phone numbers, and can discover groups your linked account is a member of.
Installation
pip install signal-cli-py
For CLI usage via isolated environment (recommended):
pipx install signal-cli-py
Note: After installing, the command is still
signal-cli(notsignal-cli-py).
Example:signal-cli send --recipient team "Hello"This is intentional — the PyPI package name is
signal-cli-pyto avoid a naming conflict with an older package.
Quick Start
As a Library
from signal_cli import SignalClient, SignalConfig
# Load from default config (~/.signal-cli/config.json)
client = SignalClient()
# Send to a saved recipient (group or phone number)
client.send("Hello from Python", recipient="team-updates")
# Send with an image
client.send(
"Weekly report",
recipient="+46700000001",
attachments=[{"filename": "report.png", "data": base64_data}]
)
# Discover live groups from your linked account
groups = client.list_remote_groups()
for g in groups:
print(g["name"], g["id"])
As a CLI
# Basic setup (stores number + API URL)
signal-cli setup
# List groups your linked account can see
signal-cli group-list --available
# Send a message
signal-cli send --recipient team-updates "Hello team"
# Send with image
signal-cli send --recipient team-updates --image ./chart.png "Weekly update"
Configuration
By default, configuration is stored at ~/.signal-cli/config.json.
You can override the config location in two ways:
# Explicit path
cfg = SignalConfig(config_path="/path/to/my-signal.json")
client = SignalClient(config=cfg)
# Via environment variable
export SIGNAL_CLI_CONFIG=/path/to/my-signal.json
Important: Linked Device Behavior
This tool is designed to be used as a linked device (not a primary registration).
- New groups created on your phone may not immediately appear when calling
list_remote_groups()orgroup-list --available. - Common triggers that make new groups visible:
- Send/receive a message inside the group from your phone
- Restart the
signal-cli-rest-apicontainer - Re-link the device (most reliable)
If a group is missing, the recommended first step is to send a message in it from your phone and then re-check.
Docker Requirement
Sending requires a running signal-cli-rest-api container (usually managed via Docker Compose).
The recommended compose file is automatically installed to ~/.signal-cli/docker-compose.yml
when you run signal-cli setup (or you can manage it yourself).
This package defaults to MODE=json-rpc in the generated compose file (long-lived
JVM daemon) for the best performance and resource characteristics in normal use.
The link command automatically starts a short-lived container using MODE=native
(the most reliable configuration for device linking) when it detects the standard
local compose file. Your normal service is left exactly as you configured it and is
restarted after linking. You should not need to edit the compose file for linking.
Development
cd signal-cli
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
License
MIT
Metadata
Release files for signal-cli-py 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| signal_cli_py-0.6.0.tar.gz | 17.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| signal_cli_py-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.0 kB
Release files / signal_cli_py-0.6.0.tar.gz
| Download URL | signal_cli_py-0.6.0.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80afd8a7fe66fe9fd06de281d1d0ce301a98d99be2a34e4fbc5a1d93c1c31831
|
|
BLAKE2b-256 checksum How to use checksums |
aa0ab2163029b08c76c10cab806d18bfb138490066a662ac8afb0f072b8aa9d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 21, 2026.
Transparency logRelease files / signal_cli_py-0.6.0-py3-none-any.whl
| Download URL | signal_cli_py-0.6.0-py3-none-any.whl |
|---|---|
| Size | 19.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
adb6c520d690de59e3c6a77f20995fd9bb87f34f5216f4c60067155f41fd8061
|
|
BLAKE2b-256 checksum How to use checksums |
98745205da0028d0038c2a0cd99c6e06499b420ed636cdc78d2b2110b547b347
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 21, 2026.
Transparency log