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.
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 |
|---|---|---|
|
duration |
Stop the command, and fail, when it runs longer than this. Default: |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |