Tresorit’s simple command-line interface runs on headless Linux workstations or servers. Compared to the graphical Tresorit client, it provides a limited feature set that can be used to automate tasks like sync and reporting in a way that best suits your needs.
Tresorit Linux executables
The Tresorit installer provides three executables (x86 and x64): tresorit (the GUI), tresorit-cli (the CLI) and tresorit-daemon (the Daemon). The tresorit-daemon runs as a daemon process. Both the GUI and the CLI can start and connect to the Daemon. If you wish, you can start the Daemon manually, or with an init script by executing the tresorit-daemon binary without any arguments.
On start, the Daemon performs autologin if it has been enabled.
When the Daemon is running, it will continue all operations it has been directed to do (synchronizing tresors, serving the Tresorit Drive, etc.) and it can automatically update itself without the need for either GUI or CLI interaction. This means that after configuring the Daemon with either the GUI or the CLI, it is sufficient to just start the Daemon on startup to automatically login and continue all sync and drive operations.
CLI - GUI interoperability
The GUI and the CLI can be used simultaneously and they will execute commands on the same Daemon instance.
If the Daemon is already running when the GUI starts (because it has been started manually or by the CLI), the GUI will connect to it, and when the GUI is closed, it will prompt you whether you want to shut the Daemon down along with it. Otherwise, if the Daemon is not yet running when you start the GUI, the GUI will automatically start it, and when the GUI is closed, it will close the Daemon without prompting you.
Using the CLI
Running the CLI
The tresorit-cli executable can be found in the client's installation path (the default is ~/.local/share/tresorit/). You can run the CLI by either changing to this directory and executing the tresorit-cli:
./tresorit-cli
Or by adding the client's installation path to your PATH environment variable and running the tresorit-cli command. This can be done by adding
export PATH="$HOME/.local/share/tresorit:$PATH"
to your shell's rc (.bashrc, .zshrc, ...)
Startup
You can start the Daemon by executing
which is equivalent to starting the tresorit-daemon manually.
Shutdown
You can stop the Daemon by executing
which is equivalent to sending a TERM signal (kill) to the tresorit-daemon.
Using help
If no subcommand is specified, using the --help option lists all built-in subcommands.
Using the --help option with a subcommand displays a help string about the subcommand and lists its options.
Porcelain
Normally the CLI displays lists and tables nicely formatted and padded with spaces.
If this is not desired, e.g. for scripting purposes, every command has a --porcelain option which generates easily parsable, machine-friendly output, separated by single tabs.
Tresor names and ids
When specifying a tresor, you can usually use its name. However, multiple tresors with the same name can exist. In this case, you have to use an unambiguous ID which is available in the tresorit-cli tresors listing (tresors with the same name will have an ID postfixed in a "Tresor Name (ID)" format.
This is the same format that is used in Tresorit Drive for handling multiple tresors with the same name, and therefore you can also use the Tresorit Drive to find out which tresor you want to specify. Using the Tresorit Drive for this purpose has the added benefit of being able to match the tresors' name and ID with its contents.
Available commands
Status
With this command you will receive a status report on the Daemon, Tresorit Drive and if there’s an active Tresorit session.
Command syntax
Proxy settings
Use this command to define the proxy settings for your Tresorit client. Depending on your network configuration, you may need to apply custom settings to succesfully login and use Tresorit.
Command syntax
proxy --no-proxy
proxy --use-system-proxy
proxy --type <type> [--host <host>] [--port <port>] [--username <username>] [--password <password>|--password-on-stdin]
Parameters
no-proxy disables proxy
use-system-proxy attempts to use the system proxy set in {https_proxy, all_proxy, http_proxy} environment variables
type type of proxy
Possible types:
None
Http
Socks4
Socks4a
Socks5
Socks5h
host hostname of the proxy
port
username username used for authentication
password password used for authentication
password-on-stdin the command will wait for the password used for authentication on the standard input
Login
With the login command, you can sign in to Tresorit from the command-line client, using your email, password and other authentication options you previously set up in your account.
Command syntax
Parameters
password
password-on-stdin the command will wait for the password on the standard input
sso initiates a Single Sign-On login sso-force initiates a Single Sign-On login enforcing reauthentication with the given email address dont-remember-me If set, does not save login secret, disabling autologin
totp One-time password used for two-factor authentication (only valid for password authentication)
Logout
Sign out of Tresorit with an option to unlink or even wipe synced files from the device you are using at the moment.
Command syntax
Parameters
wipe deletes locally stored login data and synced tresor contents
List tresors
When you enter the list tresors command, you will receive a list of your tresors in the cloud with useful information such as their sync status and location on your computer.
Command syntax
Start and stop syncing
With this command, you can start or stop syncing a tresor. Tresorit will remember this setting upon restart.
Command syntax
sync --stop <tresor_name|tresor_id>
Parameters
path when starting the sync, use path as the tresor's mount path
stop stop syncing on the tresor with the given tresor_id or tresor_name if unambiguous
Mount or unmount drive
Use this command to enable or disable Tresorit Drive on your computer. Tresorit will remember this setting upon restart.
The following packages have to be installed:
-
fuse (and libfuse2)
Debian/ubuntu/mint:
- apt-get install fuse libfuse2
openSUSE
- zypper in fuse libfuse2
Gentoo:
- emerge sys-fs/fuse
Command syntax
Parameters
unmount unmount Drive
Show sync transfers per tresor
When you enter the transfers command, you will receive a list of a tresor’s sync status: it will show if it is syncing at the moment and if so, it will include the number of files left and if are there any errors.
Command syntax
Parameters
files if set, shows individual file transfers instead of a summary (tresor name, file path, status progress)
Log and metrics settings
Use this command to enable or disable log sending and metrics. If you encounter an issue, our support team may ask you to submit your logs to speed up the investigation.
Command syntax
logging --disable-metrics|--enable-metrics
logging --status
Parameters
enable-logs-sending enables aggregated log sending
disable-metrics disables metrics
enable-metrics enables metrics
status displays current log and metrics settings
Still have questions left? Drop us a line