📖 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 operations —
ls,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(mode0600). The CLI never sees your password. - CI-friendly — set
PCLOUD_ACCESS_TOKENto skip the credential store entirely. - Regional endpoints — targets the EU API by default; switch with
PCLOUD_REGION=us.
📦 Install
npm install -g @kud/pcloud-cliRequires 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.pdfSee Authentication for the one-time OAuth setup, then Trash & restore and Rewind & versions for recovery workflows.
⚙️ Configuration
| Variable | Required | Description |
|---|---|---|
PCLOUD_CLIENT_ID | For login only | OAuth application client ID |
PCLOUD_CLIENT_SECRET | For login only | OAuth application client secret |
PCLOUD_ACCESS_TOKEN | Optional | Bypasses ~/.config/pcloud/tokens.json entirely |
PCLOUD_REGION | Optional | eu (default) or us — selects the API endpoint |
When PCLOUD_ACCESS_TOKEN is set, no stored credentials are read or written.