Skip to main content
boxd machine cp copies files in either direction. It works the same from your laptop and from inside a machine, and it does not need SSH keys or any setup. The console has a file browser for the same job, and the SDKs cover directories as well as files.

Upload and download

The side with the <machine>: prefix is the machine. Everything else is your local disk.

Where paths land

The path after <machine>: follows three rules: A bare relative path is the common case, so boxd machine cp ./notes.md myapp:notes.md puts the file in the home directory.

Whole directories

Add -r. The directory is tarred on the way out and untarred on arrival, so one call moves the whole tree. The destination is the parent to drop the directory into. The directory keeps its own name:
Naming the destination after the directory nests it, so myapp:myproject gives you /home/boxd/myproject/myproject.
Copying from macOS also carries over the ._name AppleDouble files that tar creates for extended attributes. They are harmless, and find . -name '._*' -delete inside the machine clears them.

Piping instead of files

Use - in place of a path to read from stdin or write to stdout:
Piping into machine exec works too, so cat data.json | boxd machine exec myapp -- 'jq .' behaves like a normal shell pipe. For moving bytes into a file, cp - stays the cleaner tool. It skips the shell entirely and verifies the byte count on arrival. To write somewhere root owns, upload to /tmp first and move it with exec:

Between two machines

Every machine except an isolated one has the boxd CLI inside, so a machine can copy straight to or from another machine you can access:
From your laptop there is no direct machine-to-machine copy. Download to your disk first, then upload to the other machine.

Limits

  • From your laptop and the SDKs. Uploads and downloads have no size cap.
  • From inside a machine. cp to or from another machine is capped at 1 GB per file. A -r directory counts as one file, its tar.
For large public assets, download them inside the machine with curl or git. That uses the machine’s own bandwidth instead of yours.

From the console

Open a machine and pick the Files tab. It is a file browser over the same operations:
  • Browse folders, with a .. row to go up and a path bar to jump anywhere.
  • Upload with the button, or drag files and folders from your desktop onto the table. A dropped folder arrives whole. Drop onto a folder row to upload into that folder instead of the one you are in.
  • Download a file, or a folder as a .tar.gz.
  • Copy, cut, paste, rename, delete from the right-click menu, with the usual shortcuts: Ctrl or Cmd with C, X, V, D for download, F2 to rename, Delete. Click, Shift-click and Ctrl-click select several rows, Ctrl or Cmd with A selects everything, and the arrow keys move the selection.
  • Anything that would overwrite an existing file or folder asks first, and a folder pasted or uploaded over a folder of the same name replaces it rather than nesting inside it.
Transfers show a progress bar with a cancel button. A folder holding more than 5,000 entries is listed up to that many, with a note to use exec for the full listing. The Files tab, the terminal and the desktop follow the machine’s access rule: its owner, and every member of the organization when the machine is shared. See Machine sharing.

From the SDKs

For code that works with a machine’s files, machines.fs reads, writes, lists and manages them as the machine’s user, streams files of any size and raises the errors local file code expects. See Filesystem API. The SDKs also have the calls the console’s Files tab uses: