Agentic Data Plane

rpk ai sandbox exec

Run a command in a sandbox and print what it wrote after it exits.

A single COMMAND argument is a shell script, run with bash (sh in an image without bash). After --, each word is one argument of the command, quoted for the shell. The sandboxed command’s stdout and stderr go to the matching local streams. This CLI returns the sandboxed command’s exit status, or 128 plus the signal number if a signal ended it. With -o json or -o yaml, the whole result is printed instead.

Each stream keeps its first 3 MiB. For a long-running or interactive command, or one that needs stdin, use sandbox shell.

Requires Sandbox.exec on the sandbox.

Usage

rpk ai sandbox exec SANDBOX COMMAND | SANDBOX -- WORD [word...] [flags]

Examples

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

rpk ai sandbox exec dev 'cd /workspace && make test | tail -n 20'
rpk ai sandbox exec dev -- ls -la /workspace
rpk ai sandbox exec dev --timeout 30s -o json -- uname -a

Flags

Value Type Description

--timeout

duration

Stop the command, and fail, when it runs longer than this. Default: 5m0s.

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.