Agentic Data Plane

rpk ai sandbox cp

Copy a file or directory between the local machine and a sandbox, the way docker cp does. One of SRC and DST is SANDBOX:PATH, where SANDBOX is a sandbox id or sandboxes/{id}; the other is a local path. A relative sandbox PATH is relative to /workspace. An argument that starts with /, ./ or ../, or with a Windows drive, is always local: write a local path with ':' in it as ./a:b.

Directories copy recursively, empty ones included. If DST is an existing directory, SRC is copied into it; otherwise the copy is named DST. A SRC that ends in /. copies the directory’s contents into DST instead. Executable bits are kept both ways.

Only regular files and directories are copied: a symbolic link or special file on either side fails the copy before any file is written.

The bytes go through the file API. One command in the sandbox lists a download before it starts, and one moves an upload into place, so the sandbox image needs find, mkdir, mv, chmod, cat and rm. An upload is staged next to where it lands and moved into place at the end; a failed upload removes what it staged.

The copy stops at the first error, which names the path. A failed download keeps the files already written. Like any file call, cp wakes a sandbox at rest.

Requires Sandbox.write_file, Sandbox.read_file, Sandbox.list_directory and Sandbox.exec on the sandbox.

Usage

rpk ai sandbox cp SRC DST [flags]

Examples

This section provides examples of how to use rpk ai sandbox cp.

rpk ai sandbox cp ./src dev:src
rpk ai sandbox cp dev:/workspace/out/. ./out
rpk ai sbx cp sandboxes/dev:report.pdf .

Global flags

Value Type Description

--config

string

Redpanda or rpk config file; default search paths are ~/.config/rpk/rpk.yaml, $PWD/redpanda.yaml, and /etc/redpanda/redpanda.yaml.

-X, --config-opt

stringArray

Override rpk configuration settings; -X help for detail or -X list for terser detail.

--ignore-profile

bool

Ignore rpk.yaml and redpanda.yaml; use default settings.

--profile

string

rpk profile to use.

-v, --verbose

bool

Enable verbose logging.