Getting started
Sign in
Section titled “Sign in”$ proton account loginEmail: you@proton.mePassword: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.
No terminal to answer the prompts? Name the account and point at the password (never a flag value):
proton account login --user you@proton.me --password-file /run/secrets/protonCheck where you stand at any time:
$ proton account getEmail: you@proton.meName: RomanStorage: ━━━━━─────────────── 26% 128.4 GB of 500.0 GBMax Upload: 5.0 GBProfile: defaultSession: validUnlocked: yesID: Kd91mQxT…Do something
Section titled “Do something”proton mail messages list --unreadproton mail messages get "Invoice #2291"proton drive items list /Documentsproton calendar events listproton pass items get github.comproton contacts listEvery 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.
Every command also documents itself, and points at its own page in the reference:
$ proton mail messages send --helpCompose and send a message…Global flags: proton --helpFull reference: https://proton-cli.lerchster.dev/commands/mail/#messages-sendTurn on completion
Section titled “Turn on completion”Completion covers every command and flag, and offers real values as you type: your folder names, item types, output formats and setting keys.
# zshproton completion zsh > "${fpath[1]}/_proton"
# bashproton completion bash | sudo tee /etc/bash_completion.d/proton
# fishproton completion fish > ~/.config/fish/completions/proton.fishMore than one account
Section titled “More than one account”Each profile keeps its own session, so a personal and a work account never mix:
$ proton --profile work account loginEmail: you@company.comPassword:✓ Signed in as you@company.com (profile "work").
$ proton --profile work mail messages listproton account profiles list shows what is signed in here, and export PROTON_PROFILE=work makes one the default for a shell. Profiles, sessions, environment variables and the files on disk are all in Configuration.
Sign out
Section titled “Sign out”proton account logout # forget the session on this machineproton account logout --revoke # and invalidate it at ProtonRevoking also makes the credentials saved on this machine useless, even to someone who already copied them. See Security.
When something goes wrong
Section titled “When something goes wrong”Errors say what happened and what to try:
$ proton mail messages move 5bH2mQxK --into WorkError: "Work" is a label, not a folder - moving needs a folder.Try: to attach the label instead, use `label --label Work`. To see the folders, run `proton mail settings folders list`.Before changing anything in bulk, ask what would happen:
proton mail messages trash --from newsletter@example.com --older-than 90d --dry-runWhere next
Section titled “Where next”| Page | What’s in it |
|---|---|
| The language | The grammar, the verbs, the filters, dry runs |
| Mail · Drive · Calendar · Pass · Contacts | One page per app, task by task |
| Scripting | Pipelines, jq, cron and systemd |
| Command reference | Every command, argument and flag |