pcloud-cli

🗑️ Trash & restore

List files in your pCloud trash and restore deleted files by file ID.

pCloud keeps deleted files in a trash bin before they are permanently removed. pcloud can list what is in the trash and restore individual files by their numeric file ID.

📋 List trash

pcloud list-trash

Outputs each file's ID, name, size, and deletion time.

♻️ Restore a file

Restore a file from trash by its numeric file ID:

pcloud restore-trash <fileid>

Example:

pcloud restore-trash 12345678

⚠️ OAuth limitation

Trash endpoints require a pCloud session token. OAuth 2.0 access tokens do not grant access to the underlying trash_list / trash_restore methods. This is a limitation of the pCloud API — there is no workaround via OAuth.

If you run list-trash or restore-trash with an OAuth-issued token, the CLI detects the unsupported-method response and prints a clear warning rather than failing silently.

On this page