• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

screenshots/H03-May-2022-

.gitattributesH A D22-Oct-202121 21

.gitignoreH A D22-Oct-20211.2 KiB10584

CONTRIBUTING.mdH A D22-Oct-2021660 159

LICENSEH A D22-Oct-202134.3 KiB675553

README.mdH A D22-Oct-202110.9 KiB213144

VERSIONH A D22-Oct-2021364 129

scliH A D03-May-2022165 KiB4,4913,578

setup.cfgH A D22-Oct-20211.6 KiB7958

README.md

1# scli
2`scli` is a simple terminal user interface for [Signal](https://signal.org). It uses [signal-cli](https://github.com/AsamK/signal-cli) and [urwid](http://urwid.org/).
3
4## Features
5
6- vim-like navigation (`j`, `k`, `g`, `G`, etc), command entry with `:`
7- optional emacs-like `readline` bindings for input
8- external `$EDITOR` support
9
10### Limitations
11
12- Not yet supported by [signal-cli](https://github.com/AsamK/signal-cli/issues):
13	- Quoting a message ([#213](https://github.com/AsamK/signal-cli/issues/213))
14	- Adding @-mentions in sent messages ([#584](https://github.com/AsamK/signal-cli/issues/584))
15	- Voice calls ([#80](https://github.com/AsamK/signal-cli/issues/80))
16
17- *Sending* read receipts for received messages.
18- "View once" and "expiring" messages.
19- See also: open [issues](https://github.com/isamert/scli/issues).
20
21## Installation
22### Automatic
23The following methods are supported by community and may be outdated.
24
25[![Packaging status](https://repology.org/badge/vertical-allrepos/scli-signal-cli.svg)](https://repology.org/project/scli-signal-cli/versions)
26
27### Manual
28
29Clone the repo
30
31```
32git clone https://github.com/isamert/scli
33```
34
35or download a [release](https://github.com/isamert/scli/releases).
36
37#### Dependencies
38
39- [`signal-cli`](https://github.com/AsamK/signal-cli) `>=v0.6.8`.
40
41	Download and unpack a [release](https://github.com/AsamK/signal-cli/releases), and place the `signal-cli` executable somewhere on the `$PATH`.
42
43	Or compile from source: see [install](https://github.com/AsamK/signal-cli#Installation) section of `signal-cli` readme for instructions.
44
45- [`urwid`](https://github.com/urwid/urwid)
46
47	Availble on PyPI:
48
49	```
50	pip install urwid
51	```
52
53	and in some distributions' package managers, see repology [(1)](https://repology.org/project/urwid/versions), [(2)](https://repology.org/project/python:urwid/versions).
54
55- [`urwid_readline`](https://github.com/rr-/urwid_readline/) (optional)
56
57	For GNU readline-like keybinds on the input line (emacs-like only).
58
59	```
60	pip install urwid-readline
61	```
62
63	Also in a few [package managers](https://repology.org/project/python:urwid-readline/versions).
64
65- [DBus](https://www.freedesktop.org/wiki/Software/dbus/)
66
67	Pre-installed on most linux distributions and BSDs with desktop environments. On macOS, the `dbus` package is available from homebrew, see signal-cli's [wiki](https://github.com/AsamK/signal-cli/wiki/DBus-service#user-content-dbus-on-macos). See also, wiki's [troubleshooting](https://github.com/AsamK/signal-cli/wiki/DBus-service#user-content-troubleshooting) section.
68
69- [Python](https://www.python.org/downloads/) `>=3.7`
70
71
72### Registering or linking your device
73
74Before running `scli`, `signal-cli` needs to be registered with the signal servers. You can either register a [new device](https://github.com/AsamK/signal-cli/wiki/Quickstart#user-content-set-up-an-account), or [link](https://github.com/AsamK/signal-cli/wiki/Linking-other-devices-(Provisioning)) `signal-cli` with an already registered device (e.g. your phone).
75
76Linking can be done interactively with `scli link`, see the [next section](#linking-with-scli-link).
77
78For more information, see: `signal-cli` [usage](https://github.com/AsamK/signal-cli#Usage), [man page](https://github.com/AsamK/signal-cli/blob/master/man/signal-cli.1.adoc), and [wiki](https://github.com/AsamK/signal-cli/wiki).
79
80#### Linking with `scli link`
81
82Linking with an existing account can be done interactively with
83
84```
85scli link [--name DEVICE_NAME]
86```
87
88and following instructions on the screen. The `DEVICE_NAME` is optional, `scli` is used by default.
89
90This requires [pyqrcode](https://github.com/mnooner256/pyqrcode) package (available on [PyPI](https://pypi.org/project/PyQRCode/) and other [repositories](https://repology.org/project/python:pyqrcode/versions))
91
92#### Verifying setup
93
94After registering or linking, verify that the following commands work:
95
96```
97signal-cli -u USERNAME receive
98```
99
100and
101
102```
103signal-cli -u USERNAME daemon
104```
105
106where `USERNAME` is the phone number you have used (starting with the "+" sign and including your country calling code). Kill the latter process after verifying that it starts successfully and does not throw any errors.
107
108Now you can start
109
110```
111scli
112```
113
114if you have put it on your system's `$PATH`, or specify the full `/path/to/executable/scli`.
115
116
117## Usage
118A simple two-paned interface is provided. Left pane contains the contact list and right pane contains current conversation. You can switch focus between panes with `Tab` (or `Shift + Tab`). Hitting tab for the first time focuses the conversation, hitting it again focuses to input line. So the focus order is `Contacts -> Conversation -> Input`. You can use `Shift + Tab` for cycling backwards.
119
120### Keys
121- Use `j`/`k` to go down/up in contacts list or in messages.
122- Hitting `enter` on a contact opens the conversation and focuses to input line.
123- Hitting `l` on a contact only opens the conversation.
124- Hitting `o` on a message opens the URL if there is one, if not it opens the attachment if there is one.
125- Hitting `enter` on a message opens the attachment if there is one, if not it opens the URL if there is one.
126- Hitting `y` on a message puts it into system clipboard. (needs `xclip`)
127- `g` focuses first contact/message.
128- `G` focuses last contact/message.
129- `d` deletes the message from your screen (and from your history, if history is enabled).
130- `i` show a popup that contains detailed information about the message.
131- `Alt+Enter` inserts a newline in message composing input field.
132- `Alt+J` / `Alt+K` (and `Alt+↓` / `Alt+↑`) open next / previous conversation.
133
134### Commands
135There are some basic commands that you can use. Hit `:` to enter command mode (or simply focus the input line and type `:`).
136
137- `:edit` or `:e` lets you edit your message in your `$EDITOR`.
138- `:attach FILE_PATH` or `:a FILE_PATH` attaches given file to message.
139- `:attachClip` or `:c` attaches clipboard content to message. This command tries to detect clipboard content. If clipboard contains something with the mime-type `image/png` or `image/jpg`, simply attaches the image to message. If clipboard contains `text/uri-list` it attaches all the files in that URI list to your message. This command needs `xclip` installed.
140- `:openUrl` or `:u` opens last URL in messages, if there is one.
141- `:openAttach` or `:o` opens last attachment in messages, if there is one.
142- `:toggleNotifications` or `:n` toggles desktop notifications.
143- `:toggleContactsSort` or `:s` toggles between sorting contacts alphabetically and by the most recent message.
144- `:toggleAutohide` or `:h` hides the contacts pane when it's not in focus.
145- `:addContact NUMBER [NAME]` adds a new contact to the contact list. Added contacts' names are local (not synced with signal servers).
146	_Note_: This command works only with signal-cli accounts registered as "master" (_not_ those linked with the phone app).
147- `:renameContact [ID] NEW_NAME` renames contact `ID` to `NEW_NAME`. `ID` can be either contact's phone number or contact's name. If `ID` is skipped, the contact from the currently opened conversation is used. If `ID` is a name that contains spaces, they need to be escaped or the whole name put in quotes. `NEW_NAME` can contain spaces without quotes or escaping. 'Contact' can be a group as well as an individual. Individual contacts' renames are local (not synced with the signal servers).
148	See _Note_ for `:addContact` command above.
149- `:reload` re-reads the `signal-cli`s data file. (Updates contacts list etc.)
150- `:quit` or `:q` quits the program.
151
152Examples:
153```
154:attach ~/cute_dog.png check out this cute dog!
155:attachclip here is another picture.
156```
157**Note**: Commands are case insensitive, `:quit` and `:qUiT` do the same thing.
158
159### Searching
160There is a built-in search feature. Simply hit `/` while you are on the chat window (or focus the input line then type `/`) and start typing, the chat will be filtered out based on your input. You can focus any of the search results and hit `enter` (or `l`) to open that result in full conversation.
161
162For searching through contacts, you need to hit `/` while you are on the contacts window and start typing, contacts will be filtered out while you are typing. Hit `enter` to focus the results. Hitting `Esc` will clear the search.
163
164### Configuration
165There are some simple configuration options. You can either pass them as command-line arguments or add them to your configuration file `~/.config/sclirc`. Run `scli --help` to see all options.
166
167Configuration file syntax is also pretty easy. Lines starting with `#` and empty lines are ignored, other lines are `key = value` pairs. Optional arguments (flags) like `--debug`, can be enabled in config file with any of: `true`, `t`, `yes`, `y` (with any capitalization, case insensitive).
168
169#### Example
170```sh
171scli -w 80 --enable-notifications
172```
173Configuration file equivalent of this command is:
174```ini
175## Long option forms are used in config file. (w = 80 is not valid.)
176wrap-at = 80
177enable-notifications = true
178```
179
180#### History
181
182Conversations history can be enabled with `--save-history` or `-s` flag. If enabled, the file is saved in plain text (to `~/.local/share/scli/history` by default).
183
184#### Colors
185
186Messages' text can be colorized using the `--color` option:
187
188- `--color` (no additional value)
189   Use contacts' colors from the master signal device.
190
191- `--color=high`
192	 Same as above, but use 256 colors instead of the terminal's standard 8. Colors look closer to those on official clients, but not necessarily legible on all terminals' color schemes.
193
194- `--color='{"<signal_color>": "<urwid_color>", ..., "<phone_number>": "<urwid_color>", ...}'`
195   Override colors for particular contacts or redefine signal-assigned colors; use signal-assigned colors for the rest, as above. If any of the `<urwid_color>`s is specified as a 256-color, the "high-color mode" will be turned on (like `--color=high`).
196
197- `--color='["<urwid_color_sent>", "<urwid_color_recv>"]'`
198   Use one color for sent messages and another for received messages (from any contact).
199
200The list of available `<signal_color>` names is in the [source code](https://github.com/isamert/scli/blob/9a5a49d/scli#L2925-L2939) (first column).
201An `<urwid_color>` is one of urwid's [16 standard foreground colors](https://urwid.readthedocs.io/en/latest/manual/displayattributes.html#standard-foreground-colors) (`dark green`, `yellow`, `default`, etc), or [256 foreground colors](https://urwid.readthedocs.io/en/latest/manual/displayattributes.html#color-foreground-and-background-colors) (`#f8d`, `h123`, etc).
202To see the available colors rendered in your terminal, run [palette_test.py](https://github.com/urwid/urwid/blob/master/examples/palette_test.py) from urwid's examples.
203The single quotes in `--color='...'` above are just shell-escaping, and not needed in `sclirc`.
204
205
206## Similar projects
207See [TUI clients](https://github.com/AsamK/signal-cli/wiki#user-content-terminal--tui-clients) on signal-cli wiki.
208
209## Screenshots
210![scli](screenshots/1.png?raw=true)
211![scli](screenshots/2.png?raw=true)
212![scli](screenshots/3.png?raw=true)
213