Skip to content
proton-cli

First commands

Sign in once, then read your mail, move files in and out of Drive, check your calendar and pull a two-factor code. This is the five minutes from a fresh install to a useful command.

Terminal window
$ proton account login
Email: you@proton.me
Password:
Two-factor code: 123456
✓ Signed in as you@proton.me.

That is the whole setup. Signing in saves the session and unlocks your keys, so your password is needed once on this machine and not again.

If there is no terminal to answer the prompts, name the account and point at a file holding the password. A password is never a flag value:

Terminal window
proton account login --user you@proton.me --password-file /run/secrets/proton
Terminal window
$ proton account get
Email: you@proton.me
Name: Roman
Storage: ━━━━━─────────────── 26% 128.4 GB of 500.0 GB
Max Upload: 5.0 GB
Profile: default
Session: valid
Unlocked: yes
ID: Kd91mQxT…
Terminal window
proton mail messages list --unread
proton mail messages get "Invoice #2291"
proton drive items list /Documents
proton calendar events list
proton pass items get github.com
proton contacts list

Every command reads the same way, proton <app> <collection> <verb>, and anywhere one wants an ID, a subject, name, path or address works too.

That grammar is the whole trick: learn it once and you can guess the rest.

Package installs come with it. For a script or manual install, run the line for your shell from Shell completions. Tab then offers folder names, item types, and the IDs and subjects your last listing showed.

Every command that changes something takes --dry-run. It resolves references, applies filters, and shows you the rows it would touch:

Terminal window
proton mail messages trash --from newsletter@example.com --older-than 90d --dry-run

Anything that removes permanently, or removes what a filter picked out rather than what you named, shows those rows and asks first. See Dry runs and confirmations.

Terminal window
proton account logout # forget the session on this machine
proton account logout --revoke # and invalidate it at Proton

Revoking also makes the credentials saved on this machine useless, even to someone who already copied them.

Page What it covers
How a command is built The grammar, and the verbs
Mail · Drive · Calendar · Pass · Contacts One guide per app, task by task
Account Two accounts side by side, unattended sign-in, revoking a device
Scripting Pipelines, jq, cron and systemd
All commands Every command in one table
FAQ Is this official? How does it differ from Bridge? Is my password safe?