CLI
cp
storage cp <src> <dst>
Copy bytes between local paths and the storage:// scheme. At least one side must be remote — local-to-local is rejected (use the shell). cp also accepts - for stdin (as source) or stdout (as destination):
storage cp ./photos/cat.jpg storage://photos/cat.jpg # upload
storage cp storage://photos/cat.jpg ./photos/cat.jpg # download
storage cp storage://a.jpg storage://b.jpg # remote → remote
storage cp - storage://from-stdin.txt < ./local.txt # upload from stdin
storage cp storage://config.json - | jq . # download to stdout
When the destination is -, stdout is reserved for the bytes — no confirmation line. Otherwise the success output follows the CLI’s TTY/JSON rule (see Overview).
Flags
--adapter <name>(required, or setSTORAGE_ADAPTER).--fork <name>— scope the copy into a fork.--content-type <mime>— override the Content-Type for an upload.--json/--no-json— force JSON or human output.
Why not --snapshot?
Snapshots are read-only. Passing --snapshot to cp exits 1 with a clear message; use --fork to write to a fork instead.
Same-source-and-destination is rejected
storage cp storage://x storage://x exits 1 — the upload would silently overwrite an object with itself, which is at best a no-op and on some backends destructive. Pick a different destination.