pcloud-cli

📖 Introduction

A terminal-first CLI for pCloud — list folders, restore deleted files from trash, and rewind files to an earlier version.

pcloud-cli brings everyday pCloud operations to your terminal. Browse and manage files, recover what you deleted from the trash, and roll a file back to a previous version — all without leaving the command line.

It authenticates with pCloud over OAuth 2.0, storing a token locally so you only log in once. A single PCLOUD_ACCESS_TOKEN environment variable lets you bypass stored credentials entirely for CI and scripted contexts.

✨ Features

  • Folder operationsls, stat, mkdir, rmdir, and file copy / move / rename / delete from the terminal.
  • Trash recovery — list deleted files and restore them by file ID.
  • Rewind & revisions — browse a file's version history and restore an earlier version to any destination.
  • OAuth 2.0 authentication — browser-based login; the token is stored locally at ~/.config/pcloud/tokens.json (mode 0600). The CLI never sees your password.
  • CI-friendly — set PCLOUD_ACCESS_TOKEN to skip the credential store entirely.
  • Regional endpoints — targets the EU API by default; switch with PCLOUD_REGION=us.

📦 Install

npm install -g @kud/pcloud-cli

Requires Node.js 20 or newer. The binary is exposed as pcloud.

🚀 Quick start

Authenticate once, then run any command:

pcloud login
pcloud ls /
pcloud list-rewind /Documents/report.pdf

See Authentication for the one-time OAuth setup, then Trash & restore and Rewind & versions for recovery workflows.

⚙️ Configuration

VariableRequiredDescription
PCLOUD_CLIENT_IDFor login onlyOAuth application client ID
PCLOUD_CLIENT_SECRETFor login onlyOAuth application client secret
PCLOUD_ACCESS_TOKENOptionalBypasses ~/.config/pcloud/tokens.json entirely
PCLOUD_REGIONOptionaleu (default) or us — selects the API endpoint

When PCLOUD_ACCESS_TOKEN is set, no stored credentials are read or written.

On this page