tcli commands and exit codes
This page lists every command of tcli, its arguments and options, and the exit codes.
Start with the help of the program, which lists the commands, and the help of one command, which lists its options:
tcli --helptcli send email --helpOptions of every command
Section titled “Options of every command”| Option | Meaning |
|---|---|
--config <path> |
The root folder of Tilde, ~/.config/tilde by default. A path that is a file (it exists, or ends with .toml) is the configuration file. It goes before or after the command. |
--version |
Prints only the version. |
-h, --help |
Prints the usage of tcli or of the command. |
Commands
Section titled “Commands”| Command | What it does | Page |
|---|---|---|
tcli accounts |
Lists the mail and chat accounts. It connects to nothing and shows no credential. | Accounts and check |
tcli check |
Reads the configuration and creates every part of every account. | Accounts and check |
tcli send email |
Sends a message from a mail account; the body is the standard input. | Send |
tcli send chat |
Sends a text from a chat account; the text is the standard input. | Send |
tcli read <account> <id> |
Shows one message, decrypted and checked when it is OpenPGP. | Read |
tcli cache reset <account> |
Deletes the mail cache of an account. | Cache |
tcli cache rebuild <account> |
Empties the mail cache of an account and fills it again. | Cache |
tcli cache build <account> |
Updates the mail cache of an account without emptying it. | Cache |
tcli cache search <account> <text> |
Searches the sender, subject and body in the mail cache, offline. | Cache |
tcli plugins list |
Lists the active plugins: id, name, version, author, needs. | |
tcli rules [name] |
Applies the mail rules of init.lua, or only name, to the newest messages of a folder. |
Rules |
tcli scripts |
Loads the scripts, shows what they print and log, and lists the commands and rules they added. | Scripts |
tcli watch |
Writes one line for each event of the accounts until Ctrl-c. |
Watch |
Options of each command
Section titled “Options of each command”| Command | Option | Type | Default | Meaning |
|---|---|---|---|---|
check |
--connect |
flag | off | Also logs in to every server, 15 seconds each. |
send email |
--subject |
text | required | The subject. |
send email |
--to |
list | required | A recipient, address or Name <address>; repeat it or separate with commas. |
send email |
--cc, --bcc |
list | none | Recipients in copy and in hidden copy. |
send email |
--attach |
list | none | A file to attach; repeat it for more files. |
send email |
--account |
text | the only one | The id of the mail account. |
send email |
--sign |
flag | off | Signs with OpenPGP. |
send email |
--encrypt |
flag | off | Encrypts with OpenPGP. |
send chat |
--to |
text | required | A nick or channel (IRC), a JID or room (XMPP). |
send chat |
--account |
text | the only one | The id of the chat account. |
send chat |
--join |
flag | off | Joins the channel or room first. |
read |
--folder |
text | INBOX |
The folder that holds the message. |
read |
--attachment |
number | none | The number of the attachment to save; needs --output. |
read |
--output |
path | none | The file to write; it must not exist. |
cache rebuild, cache build |
--bodies |
flag | Maildir: on | Indexes the text of every message too. |
cache rebuild, cache build |
--no-bodies |
flag | remote: on | Leaves the text out. |
cache rebuild, cache build |
--jobs |
number | processors, at most 8 | Messages of a Maildir read at once. |
cache search |
--limit |
number | 50 | The most hits to print, at least 1. |
rules |
--account |
text | the only one | The id of the mail account. |
rules |
--folder |
text | INBOX |
The folder to look at. |
rules |
--limit |
number | 50 | How many of the newest messages to look at. |
rules |
--dry-run |
flag | off | Shows the steps as planned and changes nothing. |
watch |
--account |
text | all | Only the events of one account. |
watch |
--all |
flag | off | Every event of the event bus, typing notices and flag changes included. |
watch |
--json |
flag | off | One JSON object per line. |
tcli accounts, tcli plugins list, tcli scripts and tcli cache reset take no option.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | The command did what it was asked. tcli watch ends with 0 on Ctrl-c once the accounts are closed. |
| 1 | The command failed: the configuration is wrong, an account refuses, a file is missing, a script failed. |
| 2 | The command line is wrong: an unknown command or option, an address or target that is not valid, an account that does not exist or is not chosen, nothing piped in. |
| 130 | The command was stopped with Ctrl-c. |
Some commands use the codes in their own way:
| Command | Code 1 | Code 2 |
|---|---|---|
check |
A problem in the file, a part that cannot be created, or with --connect a part that cannot connect. |
|
cache search |
The cache is off, cannot be opened or fails. No hit is still 0. | A bad account, an empty text, a text with no letter or digit, a limit under 1. |
read |
The message cannot be decrypted, or the output file exists or cannot be written. | --output without --attachment, or an attachment number the message does not have. |
rules |
A step, a script or the login failed, or the folder does not exist. | The account, the rule or the limit cannot be used. |
scripts |
A script failed, or [scripting] has enabled = false. |
An argument was given. |
watch |
Tilde does not start. Ctrl-c while the accounts start gives 130. |
The account does not exist. |
All the details are in the README of tcli.