| Ocalt Query Language
Pricing Dashboard ocalt.com v1.0

EXEC / SPAWN / KILL

Directive-only. EXEC, SPAWN, and KILL are only valid inside a DIRECTIVE block. Calling them outside a DIRECTIVE block returns an error. See DIRECTIVE → for full documentation and examples.

Why directive-only?

These verbs execute shell commands on a machine. On the Ocalt server that is meaningless — OQL verbs already cover everything the server needs to do. EXEC, SPAWN, and KILL exist so developers can control their own machines via the oql-client agent.

Quick reference

VerbDescription
EXEC "command" SET ?outRun command on target machine, wait for exit. → {stdout, stderr, exit_code}
EXEC "command" WITH "stdin" SET ?outPipe stdin into the command
SPAWN "command" SET ?pidStart background process on target machine. → PID number immediately
KILL ?pidSend SIGTERM to process by PID on target machine. → true

Usage — inside DIRECTIVE only

DIRECTIVE "my-server" OPEN NEST EXEC "systemctl restart nginx" SET ?r AFTER EMIT ?r(stdout) CLOSE NEST DIRECTIVE "my-server" OPEN NEST SPAWN "python3 /home/worker.py" SET ?pid AFTER EMIT ?pid CLOSE NEST DIRECTIVE "my-server" OPEN NEST KILL ?pid SET ?ok AFTER EMIT ?ok CLOSE NEST