CLI for Proton Drive now available

schnittbrot1 pts1 comments

sdk/cli/README.md at main · ProtonDriveApps/sdk · GitHub

//blob/show" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

//blob/show;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

Uh oh!

There was an error while loading. Please reload this page.

ProtonDriveApps

sdk

Public

Notifications<br>You must be signed in to change notification settings

Fork<br>48

Star<br>652

FilesExpand file tree

main

/README.md

Copy path

Blame<br>More file actions

Blame<br>More file actions

Latest commit

History<br>History<br>History

112 lines (73 loc) · 4.94 KB

main

/README.md

Copy path

Top

File metadata and controls<br>Preview

Code

Blame

112 lines (73 loc) · 4.94 KB

Raw<br>Copy raw file<br>Download raw file

OutlineEdit and raw actions

Proton Drive CLI

Command-line interface for Proton Drive . Use it to script backups, uploads, downloads, and sharing workflows against your cloud Drive, with machine-readable output for automation.

The CLI is built with Bun and uses the Drive SDK under the hood integrating all required dependencies (such as HTTP client, crypto library, caching, etc.).

Requirements

Bun 1.3.14 or newer (for development builds from this repository)

A Proton account and browser access for sign-in

A secret store provided by your OS:

Windows: Windows Credential Manager

macOS: Keychain Services

Linux: libsecret (e.g., GNOME Keyring, KWallet)

Download the CLI

Download the latest release from proton.me/download/drive/cli.

Install and build (from source)

From the cli directory:

bun install<br>bun run build

This produces a standalone executable at release/proton-drive with embedded Bun. Add that directory to your PATH, or invoke it with a full path.

Application identification (x-pm-appversion)

Every application using the Proton Drive service must set the x-pm-appversion header. See top-level README for more details.

Running bun run build embeds a value external-drive-sdkclijs by default. If you fork the CLI, customize this value by setting the CLI_APP_VERSION_NAME environment variable when you build.

Official release builds use cli-drive. Unmodified CLI repackaged for a distribution may use cli-drive-. Do not use this identifier for any other purpose.

Authentication

Sign-in uses the browser (no password on the command line):

./release/proton-drive auth login

After a successful login, the CLI stores the session in the OS secret store (see Where data is stored). Log out with auth logout.

Usage

Interactive shell (no arguments):

./release/proton-drive

One-shot commands (good for scripts):

./release/proton-drive filesystem list /my-files<br>./release/proton-drive filesystem upload ./local-folder /my-files/parent<br>./release/proton-drive sharing status /my-files/shared-folder

Discover commands and their usage:

./release/proton-drive help<br>./release/proton-drive filesystem upload --help

Version: (to verify the CLI and SDK versions)

./release/proton-drive version

Automation-friendly output : pass --json (-j) for structured results.

Verbose output : Use --verbose (-v) for logs directly in the console. Log level is configured separately, see Environment variables).

Thumbnails

On upload, the CLI generates WebP thumbnails for common image types (JPEG, PNG, GIF, BMP, TIFF, WebP) using Bun's built-in image API (requires Bun 1.3.14+). Use --skip-thumbnails (-t ) on filesystem upload when you do not need previews or your system doesn't support Bun's image API.

Environment variables

Variable<br>Purpose<br>Default

PROTON_DRIVE_CACHE_DIR<br>If set, cache , app data , and logs all use this single directory (portable installs, explicit data root).<br>Unset — OS-specific paths below

PROTON_DRIVE_CREDENTIALS_STORE<br>Where to persist the authenticated session: keychain (OS secret store) or pass (password-store).<br>keychain

PROTON_DRIVE_LOG_LEVEL<br>Minimum log level written by the telemetry stack: DEBUG, INFO, WARNING, ERROR.<br>DEBUG

Where data is stored

Unless PROTON_DRIVE_CACHE_DIR is set:

Purpose<br>macOS<br>Windows<br>Linux / Unix

Cache (cache-crypto.sqlite, cache-entities.sqlite)<br>~/Library/Caches/proton-drive-cli<br>%LOCALAPPDATA%\proton-drive-cli\Cache<br>$XDG_CACHE_HOME/proton-drive-cli or ~/.cache/proton-drive-cli

App data (clientUid.json, config.json,...

drive proton release data file cache

Related Articles