Copy pageSign up

File operations

Read and write sandbox files, transfer artifacts, and preserve work.

Each sandbox has its own filesystem. Your repository lives at /home/cube/workspace/<repo>. Use normal Linux tools inside the sandbox and OpenSSH tools to copy files between the sandbox and your computer.

Work with files in the sandbox

Local: open the remote repository:

cube connect feature/payments

Sandbox: inspect or create files with your usual tools:

pwd
ls
mkdir -p artifacts
printf 'Hello from Adria\n' > artifacts/hello.txt
cat artifacts/hello.txt

Other terminals in this Session see the same files. Other sandboxes have independent filesystems.

Transfer files over SSH

Local: replace YOUR_SESSION_UUID with the UUID from cube sessions, then create a temporary SSH config:

session=YOUR_SESSION_UUID
config=$(cube connect "$session" --ssh-config)

Replace your-repository with the sandbox's repository directory. Upload a local file into that checkout:

scp -F "$config" ./input.json "cube-$session:/home/cube/workspace/your-repository/input.json"

Download the artifact created above:

scp -F "$config" "cube-$session:/home/cube/workspace/your-repository/artifacts/hello.txt" ./hello.txt

For an interactive file-transfer session:

sftp -F "$config" "cube-$session"

The access grant expires after five minutes. Generate a fresh config for later connections, and remove its private temporary directory when finished.

Keep work across sessions

Files stay on the disk when you disconnect or pause. Deleting a sandbox removes its disk, including uncommitted work and generated artifacts.

Commit and push source changes you want to keep. Download artifacts and other files before deletion. New sandboxes start from GitHub and do not automatically receive files from an earlier sandbox or your computer. See Repositories and branches and Lifecycle.

On this page