froogdocs
Dashboard

DocsSandboxes

Background commands

Long jobs and servers run in the background and survive your terminal disconnecting.

$ froog exec my-box --detach -- 'npm run build && npm test'
job_3f2a9c1d8e7b6a50
$ froog logs my-box job_3f2a9c1d8e7b6a50 -f    # follow; exits with its exit code
$ froog jobs my-box                            # running, exited, killed
$ froog kill my-box job_3f2a9c1d8e7b6a50       # and everything it started
$ froog exec my-box --timeout 0 -- ./long.sh   # stream to the end
$ froog exec my-box --cwd app -e NODE_ENV=test -- npm test

Output and exit code live in ~/.froog/jobs/ and survive a stop; processes don't (lost, or paused during a warm resume). Jobs don't hold off auto-stop: froog extend NAME --hours 8. Each job is also in the command history. -e values aren't recorded.

One-off runs and pushing a folder

$ froog run -- npm test                       # new sandbox, this folder in ~/FOLDER, run, delete
$ froog run --from web-stack --size large -- make e2e
$ froog run --keep -- ./build.sh
$ froog push my-box                           # this folder to my-box:~/FOLDER
$ froog push my-box ../api --to src/api

froog run streams output and exits with the command's code. Its last stderr line: exit 0 · 4m 12s · large · not billed · run-x7k2 deleted. The sandbox has a 15-minute auto-stop the CLI keeps pushing back, so if froog run dies it's erased within 15 minutes. Ctrl-C deletes it. --keep leaves it until that auto-stop.

froog push uploads one archive over the API (up to 100 MiB compressed): in git, tracked and non-ignored files; elsewhere all but .git, node_modules, target, .venv, dist, build and the like. Same-named files are overwritten.

froog run flagDefaultWhat it does
--push DIRthis folderPush it and run there
--no-pushoffPush nothing; run in ~
--cwd DIRpushed folderWorking directory
--timeout SECSnoneStop and exit 124
-e, --env KEY=VALUEnoneVariable; KEY alone copies it from this shell
--from SAVED, --sizedefaultSaved snapshot; size
--no-envoffSkip your account's environment
--keepoffKeep the sandbox, snapshots on
--jsonoff{"type":"output",…} lines, then a summary with exit_code, elapsed_secs, deleted, kept and more

Standard input. Pipe or redirect into froog exec:

$ froog exec my-box -- python3 - < script.py
$ git diff | froog exec my-box --cwd app -- git apply
$ froog exec my-box --detach -- ./import.sh < rows.csv

Up to 1 MiB (413 stdin_too_large); upload a file for more. A pipe silent for 3 seconds is ignored. --no-stdin skips it. API: stdin or stdin_b64 on POST /exec and POST /jobs.

Writing to a running job. Start it with --stdin-open:

$ froog exec my-box --detach --stdin-open -- python3 -i
$ froog stdin my-box job_3f2a9c1d8e7b6a50 'print(6 * 7)'   # adds a newline
$ cat more.py | froog stdin my-box job_3f2a9c1d8e7b6a50
$ froog stdin my-box job_3f2a9c1d8e7b6a50 --close         # end of file

API: stdin_open: true on POST /jobs, then POST /jobs/{id}/stdin {data?, data_b64?, close?}, up to 1 MiB per call. Errors: 409 stdin_blocked (the command isn't reading; 30 s), stdin_not_open, stdin_closed, job_ended.