WEBINARLive webinar: Terraform in Buddy, Oct 21st.Terraform: plan, approve, apply with state in Buddy. Live on October 21st.Save your seat

bdy sandbox cp

View as Markdown
$bdy sandbox cp [options] <source> <destination>

Copy files and directories between the local machine and a sandbox (downloading needs only SANDBOX_READ, uploading SANDBOX_WRITE) Required scopes: SANDBOX_READ, SANDBOX_WRITE

ARGUMENTS
source
Local path or sandbox path (sandbox-id:/path) (required)
destination
Local path or sandbox path (sandbox-id:/path) (required)
OPTIONS
--context <name>
Connection and scope context: default, git, link or a saved name. Overrides the globally active context for this invocation.
--examples
Show only examples; with this flag --format accepts text, json or jsonl
--verbose
Show REST API requests, responses, timing and retries on stderr
-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
--scope <scope>
Force scope (WORKSPACE, PROJECT, ENVIRONMENT). By default calculated by provided options and environmental variables (--project,
--environment
BUDDY_PROJECT, linked project)
-e, --environment <identifier>
Environment identifier
-m, --merge
Merge contents of the destination directory with sandbox content
-r, --replace
Replace contents of the destination directory with sandbox content
-u, --user <user>
User used to upload files to sandbox. Default: buddy
--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.
--format <text|json>
Output format: json, text. JSON CLI errors: {error:{code,message,hint}}, exit 1. Default: text (choices: "text", "json")
-h, --help
display help for command

Documentation for bdy v1.25.20

Last modified on Oct 14, 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$
If local directory already exists you must merge it or replace it
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$
If local directory already exists you must merge it or replace it
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/**"$