kosa8 docs Dashboard
esc
↑ ↓ move↵ openRuns in your browser; nothing you type is sent anywhere.

CLI / run

kosa8 run

Run a command or script on kosa8 Cloud (serverless), or an image in the local engine

Usage#

kosa8 run IMAGE [COMMAND] [ARG...] | run "COMMAND" | run SCRIPT [ARG...]

Serverless first: kosa8 run "COMMAND" or kosa8 run script.py runs on kosa8 Cloud in one call, in a fresh microVM, and prints the output, its cost when the API reports it, and a link to the run. Not signed in? kosa8 init (free Starter, no card). More below.

With an IMAGE, it runs in kosa8's local engine VM (kosa8 daemon start) rather than on your host, so the container cannot see your filesystem unless you mount something into it.

The image is pulled automatically the first time you ask for it. If your organisation has installed a policy, the registry it comes from must be on the allowlist or the pull is refused before anything runs.

For work you want to isolate further — a coding assistant, an untrusted script — put it in its own sandbox instead: kosa8 sandbox run.

--cloud runs it on kosa8 Cloud instead: a cloud sandbox of IMAGE runs the command (with -it, a terminal) and is deleted when it ends. Not signed in, it runs kosa8 login first.

Serverless: give one quoted command, or a script file (.py, .js, .ts, .sh), and it runs on kosa8 Cloud in one call (POST /v1/run): a fresh sandbox from the warm pool, output streamed as it prints, the sandbox deleted after, billed per second. The language comes from the file's extension. It prints a link to the run and exits with the command's exit code.

--repo OWNER/NAME[@REF] (or . for this checkout) clones a GitHub repo into the cloud sandbox first and runs the command in it (kosa8 github connect, once).

Options#

FlagTypeWhat it doesDefault
--cloudboolrun it on kosa8 Cloud instead (signs you in first if needed)—
-d, --detachboolrun in the background and print the container id—
-e, --envstringArrayset an environment variable: KEY=VALUE (repeatable)[]
--github-checkstringnext release with --repo: put the run's result on the cloned commit as a GitHub check run (named kosa8/run, or --github-check=NAME)—
-i, --interactiveboolkeep stdin open—
--namestringassign a name to the container—
--networkstringattach to a named network (default: kosa8)—
--outstringArrayserverless run: bring a file back from /workspace into this directory (repeatable)[]
-p, --publishstringArraypublish a container port to the host: [HOST:]CONTAINER[]
-q, --quietboolserverless run: print only the command's own output—
--repostringnext release kosa8 Cloud: clone this GitHub repo first and run in it: OWNER/NAME[@REF], or . for this checkout (kosa8 github connect first)—
--rmboolremove the container when it exits (the default for a foreground run)—
--shareboolserverless run: make its run card public (command, output, duration; never env or files)—
--sizestringserverless run: sandbox size, vCPU x GiB (0.5x1, 1x2, 2x4, 4x8, …; kosa8 cloud sizes)—
--templatestringserverless run: template (default: the language's own)—
--timeoutdurationserverless run: stop it after this long (default 60s, at most 1h)0s
-t, --ttyboolallocate a pseudo-TTY (implies -i)—
--uploadstringArrayserverless run: send a local file along, into /workspace (repeatable)[]

Example#

  kosa8 run "python3 -c 'print(1)'"
  kosa8 run train.py --epochs 3
  kosa8 run --upload data.csv --out chart.png plot.py
  kosa8 run alpine echo hello
  kosa8 run -it alpine sh
  kosa8 run --cloud python:3.12-slim python3 -c 'print(1+1)'
  kosa8 run --repo acme/app@main "npm ci && npm test"   # in a clone of the repo
  kosa8 run --cloud --repo . node:22 npm test             # this checkout's repo and branch

The kosa8 weekly

Agent security news, one industry deep-dive and a hands-on challenge, every Monday. Unsubscribe in one click.

© 2026 kosa8 · kosa8.com · Zero Trust cybersecurity infrastructure for AI agents · Local models served by llamay · Agent gateway: MAQPNA