| Crates.io | cloudreve-cli |
| lib.rs | cloudreve-cli |
| version | 0.5.0 |
| created_at | 2026-01-14 08:13:58.732063+00 |
| updated_at | 2026-01-24 01:29:17.926032+00 |
| description | Command-line interface for Cloudreve API |
| homepage | |
| repository | https://github.com/larriti/cloudreve-cli |
| max_upload_size | |
| id | 2042396 |
| size | 310,528 |
A powerful command-line interface for Cloudreve, providing easy access to all major Cloudreve API features from your terminal.
~/.config/cloudreve-cli/config.toml--log-prefix option for debuggingcargo install cloudreve-cli
Or install a specific version:
cargo install cloudreve-cli --version 0.3.0
git clone https://github.com/larriti/cloudreve-cli
cd cloudreve-cli
cargo build --release
The binary will be available at target/release/cloudreve-cli.
First, authenticate with your Cloudreve instance:
cloudreve-cli --url https://your-cloudreve-instance.com auth
You'll be prompted for your email and password. The token is cached for future use.
# List files in root directory
cloudreve-cli file list --path /
# Upload a file
cloudreve-cli file upload --file ./photo.jpg --path /photos
# Download a file
cloudreve-cli file download --uri /photos/photo.jpg --output ./
# Get file information
cloudreve-cli file info --uri /photos/photo.jpg
# Batch upload multiple files
cloudreve-cli file batch-upload --paths file1.txt file2.jpg --dest /docs
# Batch upload with recursive directory support
cloudreve-cli file batch-upload --paths ./my-folder --dest /backup --recursive
# Batch download multiple files
cloudreve-cli file batch-download --uris /file1 /file2 --output ./downloads
# Search by name
cloudreve-cli file search --name "report" --recursive
# Search PDF files larger than 1MB
cloudreve-cli file search --extension pdf --min-size 1048576 --recursive
# Search only folders
cloudreve-cli file search --type folder --name "backup"
# Sync local files to remote (preview only)
cloudreve-cli file sync --local ./docs --remote /docs --direction up --dry-run
# Sync remote files to local
cloudreve-cli file sync --local ./docs --remote /docs --direction down
# Preview text file
cloudreve-cli file preview --uri /notes.txt --type text
# Preview JSON with formatting
cloudreve-cli file preview --uri /config.json --type json
# Compare local and remote files
cloudreve-cli file diff --local ./file.txt --remote /file.txt
Create a configuration file at ~/.config/cloudreve-cli/config.toml:
# ~/.config/cloudreve-cli/config.toml
default_url = "https://your-cloudreve-instance.com"
default_email = "user@example.com"
default_policy = "1"
default_upload_path = "/"
default_download_dir = "./downloads"
log_level = "info"
With this configuration, you can omit the --url parameter:
cloudreve-cli file list --path /
Generate completion scripts for your shell:
cloudreve-cli completions --shell zsh > ~/.zsh/completion/_cloudreve-cli
Add to your ~/.zshrc:
fpath=(~/.zsh/completion $fpath)
autoload -U compinit && compinit
cloudreve-cli completions --shell bash > ~/.local/share/bash-completion/completions/cloudreve-cli
cloudreve-cli completions --shell fish > ~/.config/fish/completions/cloudreve-cli.fish
| Option | Description |
|---|---|
--url |
Cloudreve instance URL |
--email |
Login email |
--token |
Authentication token |
--log-level |
Log level (trace, debug, info, warn, error) |
--log-prefix |
Show full log prefix with timestamp and level |
| Command | Description |
|---|---|
file list |
List files in a directory |
file info |
Get file information |
file upload |
Upload a file |
file download |
Download a file |
file delete |
Delete files |
file rename |
Rename a file |
file move |
Move files |
file copy |
Copy files |
file mkdir |
Create a directory |
file batch-upload |
Upload multiple files/directories |
file batch-download |
Download multiple files |
file search |
Search for files |
file sync |
Synchronize files |
file preview |
Preview file content |
file diff |
Compare local and remote files |
| Command | Description |
|---|---|
user info |
Get user information |
user quota |
View storage quota |
user policies |
List storage policies |
| Command | Description |
|---|---|
share list |
List my share links |
share create |
Create a share link |
share update |
Update a share link |
share delete |
Delete a share link |
| Command | Description |
|---|---|
settings get |
Get settings |
settings set |
Set configuration value |
cloudreve-cli file upload --file large-file.zip --path /uploads
# [00:00:15] [======================>] 50/100 chunks (0:00:15)
cloudreve-cli file batch-upload --paths ./project --dest /backups --recursive
# Starting batch upload of 1 items
# ✓ Uploaded: ./project/src/main.rs
# ✓ Uploaded: ./project/src/utils.rs
# Batch upload summary:
# Uploaded: 15 files
# Failed: 0 files
# Total size: 1.25 MB
# Find all PDF files
cloudreve-cli file search --extension pdf --recursive
# Download the found files
cloudreve-cli file batch-download --uris /doc1.pdf /doc2.pdf --output ./pdfs
By default, the CLI shows clean output without log prefixes. For debugging, use --log-prefix:
# Clean output (default)
cloudreve-cli file list --path /
# Listing files in path: /
# With full log prefix
cloudreve-cli file list --path / --log-prefix
# [2025-01-14T12:34:56Z INFO] Listing files in path: /
Tokens are cached in ~/.cache/cloudreve-cli/tokens.json. To re-authenticate:
cloudreve-cli auth
If you encounter connection issues:
https://)--log-level debug for detailed logscloudreve-cli --log-level debug --url https://instance.com file list --path /
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please file an issue.