vakna shell: run a command in a box
Note
This page is generated from a mock CLI, and its numbers are placeholders.
Verified against vakna 0.0.0-mock on · generated from the CLI's own definitions
vakna shell: run a command in a box; its output and exit code pass through.
Synopsis
sh
vakna shell <box> -- <command>Flags
| Flag | Default | What it does |
|---|---|---|
--format <format> |
text |
text, or json: one JSON object per line |
--json |
off |
the same as --format json |
-h, --help |
off |
this help |
Examples
Example
sh
vakna shell api -- pnpm testprints 212 passed, 0 failed
ran pnpm test · exit 0 38.24s
Exit code 0.
Another example
sh
tar c . | vakna shell api -- tar x -C /srcprints ran tar x -C /src · exit 0 0.40s
Exit code 0.
When it fails
sh
vakna shell docs -- lsprints vakna: box docs is suspended
hint: vakna resume docs # suspended 2h 10m
Exit code 255.
Exit codes
| Code | Meaning |
|---|---|
| 0 | ok |
| 2 | usage: a missing argument, an unknown flag or command |
| 255 | vakna failed under shell, run, try or fork |
JSON output
With --format json (or --json) every line is one JSON object. v is the format's version; mocked marks numbers from the mock.
sh
vakna shell api --json -- pnpm testprints 212 passed, 0 failed
{"v":1,"event":"ran","box":"api","id":"sbx_eu1a_01JB7X9K3M4N5P6Q7R8S9T0V1W","command":"pnpm test","exit":0,"ms":38240,"mocked":true}
Errors
vakna: unknown command, unknown flag or missing argument: Runvakna <command> --helpand fix the command line it points to.vakna: no box "<box>": Runvakna listand use a name from it.vakna: "<id>" matches more than one box: Use the box's name or its full id;vakna listshows both.vakna: box <box> is suspended: Runvakna resume <box>, then run your command again.vakna: lockdown blocked <host>: Runvakna net allow <host>with the host the error names, then run your command again.
--help
This page and the help text come from one definition.
Output
vakna shell · run a command in a box; its output and exit code pass through
usage
vakna shell <box> -- <command>
flags
--format <format> text, or json: one JSON object per line (default: text)
--json the same as --format json (default: off)
-h, --help this help (default: off)
examples
vakna shell api -- pnpm test
tar c . | vakna shell api -- tar x -C /src
exit codes
0 ok
2 usage: a missing argument, an unknown flag or command
255 vakna failed under shell, run, try or fork