This command is marked as unstable and may change in future releases.
Command: phala cp
Syntax
phala cp [options] <source> <destination>
Description
Copy files to/from a CVM via SCP
Arguments
| Argument | Description |
|---|
<source> | Source path (local or cvm-name:path, use :path for phala.toml cvm_id) |
<destination> | Destination path (local or cvm-name:path, use :path for phala.toml cvm_id) |
Options
| Option | Description |
|---|
-i, --identity <value> | SSH identity file (private key) |
-p, --port <value> | SSH port (priority: CLI > phala.toml > 443) |
-g, --gateway <value> | Gateway domain (priority: CLI > phala.toml > API) |
-r, --recursive | Recursively copy directories |
-v, --verbose | Show verbose SCP details |
--dry-run | Print SCP command without executing |
Global Options
| Option | Description |
|---|
-h, --help | Show help information for the current command |
--version | Show CLI version |
--api-token TOKEN, --api-key TOKEN | API token used for authentication |
-j, --json, --no-json | Output in JSON format |
--api-version <value> | API version to use (e.g. 2025-10-28, 2026-01-21) |
Examples
phala cp ./local.txt :/root/remote.txt
phala cp ./local.txt app_123:/root/remote.txt
phala cp app_123:/root/remote.txt ./local.txt
phala cp -g dstack-pha-prod7.phala.network -p 16185 ./file.txt app_123:/root/
- Upload directory recursively
phala cp -r ./local_dir app_123:/root/remote_dir
phala cp -i ~/.ssh/custom_key app_123:/root/file.txt ./file.txt
- Print the SCP command without executing
phala cp ./local.txt app_123:/root/remote.txt --dry-run