bdy sandbox cp

$bdy sandbox cp [options] <source> <destination>

Copy files/directories to sandbox

ARGUMENTS
source
Local path or sandbox path (sandbox-id:/path) (required)
destination
Local path or sandbox path (sandbox-id:/path) (required)
OPTIONS
-w, --workspace <domain>
Workspace URL handle. Can be set via variable: BUDDY_WORKSPACE
-p, --project <name>
Project name. Can be set via variable: BUDDY_PROJECT
-m, --merge
Merge contents of the destination directory with sandbox content
-r, --replace
Replace contents of the destination directory with sandbox content
--ignore <patterns...>
Ignore files matching glob patterns when uploading (e.g., --ignore "node_modules/" "/_.log" ".git/*_"). Patterns are matched against the path relative to source.
-h, --help
display help for command

Documentation for bdy v1.22.49

Last modified on May 19, 2026

Examples

## copy file from sandbox to local directory with a new name
bdy sb cp sandbox-identifier:/path/to/file /path/to/dir/name$
## if local path file already exists you must replace it
bdy sb cp sandbox-identifier:/path/to/file /path/to/dir/name --replace$
## copy file from sandbox INTO local directory
bdy sb cp sandbox-identifier:/path/to/file /path/to/dir/$
## if local directory already exists you must merge it or replace it
bdy sb cp sandbox-identifier:/path/to/file /path/to/dir/ --merge bdy sb cp sandbox-identifier:/path/to/file /path/to/dir/ --replace$$
## copy directory from sandbox to local directory with a new name
bdy sb cp sandbox-identifier:/path/to/dir /path/to/dir$
## if local directory already exists you must replace it
bdy sb cp sandbox-identifier:/path/to/dir /path/to/dir --replace$
## copy directory from sandbox INTO local directory
bdy sb cp sandbox-identifier:/path/to/dir /path/to/dir/$
## if local directory already exists you must merge it or replace it
bdy sb cp sandbox-identifier:/path/to/dir /path/to/dir/ --merge bdy sb cp sandbox-identifier:/path/to/dir /path/to/dir/ --replace$$
## copy local file to sandbox with a new name
bdy sb cp /path/to/file sandbox-identifier:/path/to/dir/name$
## copy local file into sandbox directory
bdy sb cp /path/to/file sandbox-identifier:/path/to/dir/$
## copy contents of local directory to sandbox directory
bdy sb cp /path/to/dir sandbox-identifier:/path/to/dir$
## copy local directory into sandbox directory
bdy sb cp /path/to/dir sandbox-identifier:/path/to/dir/$
## upload a directory while ignoring globs (repeat --ignore for multiple patterns)
bdy sb cp /path/to/dir sandbox-identifier:/path/to/dir --ignore "node_modules/**" "**/*.log" ".git/**"$