vakna run: create a box and run a command in it
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 run: create a box and run a command in it; the box's name goes to stderr.
Synopsis
sh
vakna run [box] -- <command>Flags
| Flag | Default | What it does |
|---|---|---|
--rm |
off |
delete the box when the command exits |
--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 run api-2 -- make testprints created api-2 · started in 0.41s · cold boot
ran make test · exit 0 0.40s
Exit code 0.
Another example
sh
vakna run --rm -- pytestprints created box-1 · started in 0.41s · cold boot
208 passed, 4 failed
ran pytest · exit 1 52.11s
deleted box-1
Exit code 1.
When it fails
sh
vakna run api-2prints vakna: the mock can't open an interactive shell; give a command after --
hint: vakna run --help
Exit code 2.
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 run api-2 --json -- make testprints {"v":1,"event":"created","box":"api-2","id":"sbx_eu1a_01JB83A1B2C3D4E5F6G7H8J9K0","ms":405,"from":"cold","mocked":true}
{"v":1,"event":"ran","box":"api-2","id":"sbx_eu1a_01JB83A1B2C3D4E5F6G7H8J9K0","command":"make test","exit":0,"ms":400,"mocked":true}
Errors
vakna: unknown command, unknown flag or missing argument: Runvakna <command> --helpand fix the command line it points to.vakna: a box named <box> already exists: Pick another name, or delete the old box withvakna delete <box>first.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 run · create a box and run a command in it; the box's name goes to stderr
usage
vakna run [box] -- <command>
flags
--rm delete the box when the command exits (default: off)
--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 run api-2 -- make test
vakna run --rm -- pytest
exit codes
0 ok
2 usage: a missing argument, an unknown flag or command
255 vakna failed under shell, run, try or fork