Verb Index
Every verb, modifier, declaration, and system variable in OQL — source-canonical, grouped by category.
Tier limits
OQL API access is gated by the Ocalt account tier of the authenticating namespace.
| Tier | Queries / day | Concurrent instances | Storage (total) | /mounted/ storage |
| Free | 100 | 1 | 4 GB | — |
| Starter | 10,000 | 4 | 8 GB | 4 GB |
| Pro | 100,000 | 16 | 64 GB | 60 GB |
| Enterprise | 1,000,000 | 64 | 256 GB | 252 GB |
A concurrent instance is one active /v1/query request in flight for the namespace. Exceeding the limit returns InstanceLimitExceeded. Exceeding the daily query count returns QuotaExceeded. Both reset at UTC midnight.
Modifiers
Modifiers appear after the verb operand. All are optional unless stated. String values accept double quotes, single quotes, or backticks interchangeably.
| Modifier | Meaning |
AS "value" | Mode, format, direction, or target type depending on verb |
AT "position" | Coordinate, timestamp, or position |
ATTACH ?val | Secondary value passed alongside the operand (verb-specific) |
FORMAT "value" | Sort direction ("desc"), date format, or unit |
FROM n | Start position, source database, or source currency |
INTO "path" | Output path, destination variable, or target array |
LIMIT n | Maximum row count |
ON "value" | TTL in seconds (CACHE/EXPIRE), cron expression (CRON), or event name (WATCH) |
SORT BY "col" | Database sort column |
TO n | End position, target length (PAD), or destination |
USING "algo" | Algorithm identifier for HASH, SIGN, VERIFY, FLIP, FILTER |
WHERE condition | Filter condition — column expression for database, needle for string search verbs, pattern for MATCH/SEARCH |
WITH "value" | Body, pad character, delimiter, secret key, secondary input, or label |
Chain operators
| Operator | Behaviour |
AFTER | Sequential — next step runs after current completes |
AND | Parallel — branches execute simultaneously on the thread pool; results collected as array or multivariable |
OR | Fallback — runs only if the preceding step errored or returned null |
Block delimiters
| Keyword | Meaning |
OPEN NEST | Begin a block body |
CLOSE NEST | End the innermost open block |
CLOSE ALL NESTS | End all open blocks at once |
Binding
| Keyword | Meaning |
SET ?name | Bind result to ?name in scope; variable persists for the remainder of the query |
UNSET ?name | Remove ?name from scope; subsequent reads of that variable return null |
Output
| Verb | Description |
EMIT ?val | Returns ?val as the query result. In a sequential chain the last EMIT wins. EMIT ?v AND EMIT "y" collects both into [v, "y"]. Inside an HTML block appends to HTML buffer instead. Inside an EMAIL block appends to email body. On a multivariable returns one random branch. → operand passthrough. Full EMIT docs → |
Comparison operators (IF / WHERE / WHILE)
| Singular | Plural (SOME / WHILE SOME) |
IS EQUAL TO | ARE EQUAL TO |
IS IDENTICAL TO | ARE IDENTICAL TO |
IS NOT EQUAL TO | ARE NOT EQUAL TO |
IS GREATER THAN | ARE GREATER THAN |
IS LESS THAN | ARE LESS THAN |
IS GREATER THAN OR EQUAL TO | ARE GREATER THAN OR EQUAL TO |
IS LESS THAN OR EQUAL TO | ARE LESS THAN OR EQUAL TO |
IS NULL | ARE NULL |
IS NOT NULL | ARE NOT NULL |
CONTAINS | CONTAIN |
MATCHES | MATCH |
Control flow
| Statement | Description |
IF ?val IS EQUAL TO "x" OPEN NEST ... CLOSE NEST | Execute block if condition passes. !STATE(IF) set to boolean result. |
IF SOME ?arr IS EQUAL TO "x" OPEN NEST ... CLOSE NEST | Execute block if any element satisfies the condition. !STATE(IF) set to match count. |
ELSE IF ?val IS ... OPEN NEST ... CLOSE NEST | Chained condition; evaluated only when no preceding IF/ELSE IF executed. |
ELSE OPEN NEST ... CLOSE NEST | Executes when no preceding IF or ELSE IF condition passed. |
WHILE ?val IS ... OPEN NEST ... CLOSE NEST | Loop until condition fails. !STATE(WHILE) set to boolean result each iteration. Hard limit: 1,000,000,000 iterations. |
WHILE SOME ?arr IS ... OPEN NEST ... CLOSE NEST | Loop while any element satisfies condition. !STATE(WHILE) set to match count. |
FOREACH ?collection AS ?item OPEN NEST ... CLOSE NEST [SET ?results] | Iterate over array elements. !INDEX = 0-based position, !VALUE = current item. Each iteration's last result collected into array; bound via SET if provided. |
REPEAT n OPEN NEST ... CLOSE NEST [SET ?index] | Execute block n times. 0-based iteration index bound via SET if provided. |
SWITCH ?val OPEN NEST CASE "x" OPEN NEST ... CLOSE NEST DEFAULT OPEN NEST ... CLOSE NEST CLOSE NEST | Match ?val against each CASE value; first match executes. DEFAULT executes when no case matches. |
RETURN ?val | Exit the current operation or block immediately, returning ?val as its result. |
EXIT ALL | Terminate the entire query graph immediately, including all enclosing blocks and operations. |
Operations
Ephemeral operations are scope-local to the current query. Persistent operations are stored in AppState and survive across queries.
| Statement | Description |
NEW OPERATION AS "name" OPEN NEST ... CLOSE NEST | Define an ephemeral operation. Errors if "name" already exists in scope. |
NEW PERSISTENT OPERATION AS "name" OPEN NEST ... CLOSE NEST | Define a stored operation that persists across queries. Errors if "name" already exists in store. |
ALTER OPERATION "name" OPEN NEST ... CLOSE NEST | Redefine an existing ephemeral or persistent operation. Errors if "name" does not exist. |
EXECUTE "name" [SET ?result] | Invoke a named operation. Searches scope-local first, then store. |
EXECUTE OPERATION "name" [SET ?result] | Alias for EXECUTE "name". |
OPERATION LIST SET ?arr | → array of operation name strings from the store |
OPERATION DESCRIBE "name" SET ?op | → operation name string or null if not found |
OPERATION DELETE "name" SET ?ok | Delete a persistent operation from the store. → true |
Error handling
| Statement | Description |
CATCH ERROR SET ?msg | Intercepts the error message from the most recently failed step and binds it to ?msg. Returns null if no error pending. Execution continues on the next step. |
CATCH ERROR RESET | Clears the pending error without binding it. Subsequent steps proceed normally. |
CALCULATE / COLLAPSE
| Statement | Description |
CALCULATE "expr" SET ?result | Evaluate a math expression string. Reference OQL variables as ?name within the expression. Supports standard arithmetic, operator precedence, and functions: floor ceil sqrt abs pow min max round. |
COLLAPSE ?multivariable SET ?arr | Merge the results of AND-parallel branches into a single array. Pruned branches produce null entries. |
NEW JSON OBJECT
| Syntax | Description |
NEW JSON OBJECT OPEN NEST SET "key" AS ?val ... CLOSE NEST SET ?obj | Construct a JSON object literal. Each SET "key" AS expr line inside the block adds one key–value pair. Keys are string literals. Values are any OQL expression. Returns completed object. |
NEW ARRAY
| Verb | Key modifiers |
NEW ARRAY OPEN NEST ENLIST ?val ... CLOSE NEST SET ?arr | ENLIST is only valid inside a NEW ARRAY block. Each ENLIST line appends one element to the array under construction. |
String verbs
| Verb | Key modifiers |
UPPER "text" | — |
LOWER "text" | — |
UCWORDS "text" | Title-case all words |
TRIM STRING "text" / TRIM "text" | Strip leading and trailing whitespace |
LENGTH "text" | → character count for text, element count for arrays, byte count for binary |
REPLACE "text" | WHERE "find" WITH "repl" — literal replacement. AS "regex" for regex mode. FROM n TO n WITH "repl" for positional substr_replace (0-based). |
SPLIT "text" | WITH "delim" — default delimiter ",". → array of strings |
JOIN ?array | WITH "delim" — default delimiter "". → string |
PAD "text" | TO n WITH "char" AS "left"|"right"|"both" — default direction "left" |
SLICE "text" | FROM n TO n — 0-based character positions (start inclusive, end exclusive). Also works on arrays. |
SUBSTR "text" | FROM n WITH length — extract substring by start position and character count. FROM is 0-based; WITH omitted means to end of string. Unlike SLICE, uses start+length not start+end. |
CONTAINS "text" | WHERE "needle" → boolean |
STARTS "text" | WHERE "prefix" → boolean |
ENDS "text" | WHERE "suffix" → boolean |
INDEX "text" | WHERE "needle" → 0-based byte position or null if not found |
REPLICATE "text" | WITH n — repeat string n times |
CHARS "text" | → array of single-character strings |
WORDS "text" | → array of whitespace-delimited words |
MATCH "text" | WHERE "pattern" — regex match. AS "all" returns all matches as array. Single match otherwise. Errors if no match found. |
REVERSE "text" | → string reversed character by character. Also works on arrays (element order). |
STRING ?val | Coerce any value to its text representation |
Compute verbs
| Verb | Key modifiers |
CAST ?val | AS "text"|"number"|"boolean"|"json" |
UUID | → UUID v4 string |
RANDOM | FROM min TO max — random integer in [min, max] inclusive. FROM defaults to 0. |
HASH "text" | USING "SHA256"|"SHA1"|"MD5" — default "SHA256". SHA1 and MD5 are stub implementations returning a SHA256-derived prefix with a type marker; use SHA256 for production. |
ENCRYPT "text" | WITH "password" USING "AES-256" — AES-256-GCM; key derived via PBKDF2-HMAC-SHA256 (10 000 iterations, fixed salt). Output: base64(nonce||ciphertext). |
DECRYPT "text" | WITH "password" USING "AES-256" — decrypts ENCRYPT output. Errors on wrong password or corrupted data. |
SIGN ?payload | USING "JWT" WITH "secret" — HS256 JWT. Payload must be an object or array. → signed JWT string |
VERIFY ?token | USING "JWT" WITH "secret" — validates HS256 signature. → decoded payload object or error on mismatch |
COMPARE "plain" | WITH "hash" — constant-time bcrypt comparison via accounts bridge. → boolean |
ENCODE "text" | AS "base64" — encodes text or binary to base64 string |
DECODE "text" | AS "base64" — decodes base64 string to binary |
VALIDATE ?data | GATHER-style field validation — not yet implemented; always returns error |
LOG ?val | AS "info"|"warn"|"error" — writes [OQL LEVEL] value to server stdout. Default level "info". → true |
TIME | AS "date"|"time"|"year"|"month"|"month-name"|"day"|"day-name"|"hour"|"minute"|"second"|"unix"|"weekday" — current server time. No AS → ISO-8601 "YYYY-MM-DDTHH:MM:SSZ". Operand overload: TIME ?ts AS "year" extracts part from a Unix timestamp or ISO-8601 string. |
Array verbs
| Verb | Key modifiers |
NEW ARRAY OPEN NEST ... CLOSE NEST | ENLIST ?val inside — append element at construction time |
APPEND ?val INTO ?arr | Push ?val to end of existing array. Null target creates a new single-element array. |
APPEND ?val AS "key" INTO ?obj | Set or add key on existing object. AS can be a numeric index to insert at that position in an array. Null target creates a new object. |
COLLAPSE ?multi | Merge AND-parallel multivariable into a flat array |
SORT ?arr | WITH "field" for arrays of objects. FORMAT "desc" for descending. |
REVERSE ?arr | Reverse element order. Also reverses a string. |
UNIQUE ?arr | Remove duplicate primitives (compared by display string) |
FLATTEN ?arr | Remove one level of nesting |
FIRST ?arr | → first element or null |
LAST ?arr | → last element or null |
PLUCK ?arr | WHERE "fieldname" — extract named field from each object in array. → array of field values |
SLICE ?arr | FROM n TO n — 0-based element positions. Also works on strings. |
REMOVE "key" FROM ?arr | Remove element at numeric index from array, or named key from object. Writes result back to ?arr. Array elements after the removed index shift down automatically. |
REPACK ?arr | Re-index numeric string keys on an object to 0..n-1 after removals. No-op on arrays (always contiguous). Useful after multiple REMOVE FROM operations on an object acting as a sparse array. |
Parse & Transform verbs
| Verb | Accepted input / returns |
PARSE JSON ?val | JSON string → object or array |
PARSE CSV ?val | CSV string → array of row objects (first line = headers) |
PARSE XML ?val | XML string → {raw, type:"xml"} — structural parse deferred |
PARSE YAML ?val | YAML string → object or array |
PARSE HTML ?val | HTML string → {raw, type:"html"} — DOM parse deferred |
PARSE MARKDOWN ?val | Markdown string → HTML string |
PARSE TOML ?val | TOML string → object |
PARSE INI ?val | INI string → nested object keyed by section; default section key "default" |
PARSE RSS ?val | RSS XML string → array of item objects: {title, link, description, pubDate, guid, author, category} |
PARSE ATOM ?val | Atom XML string → array of entry objects: {title, id, updated, summary, content, author, link} |
PARSE PDF "/root/path" | PDF file path → extracted text string |
PARSE DOCX "/root/path" | DOCX file path → extracted text string |
PARSE XLSX "/root/path" | XLSX file path → array of row arrays (each row is array of cell strings) |
PARSE ODT "/root/path" | ODT file path → extracted text string (same handler as DOCX) |
PARSE BASE64 ?val | Base64 string → binary |
PARSE TEXT ?val | Passthrough — returns operand as text string |
EXTRACT ?val | WHERE "selector" — regex on text, dotted key path on object, [*].field on array. AS "all" returns all matches as array. |
CONVERT "/root/src" | AS "format" INTO "/root/dst" — image→image (ImageMagick): jpg jpeg png gif webp tiff bmp ico svg avif heic heif. video→video (FFmpeg): mp4 mov avi mkv webm flv wmv m4v 3gp. video/audio→audio: mp3 wav ogg flac aac m4a. document (LibreOffice): pdf docx doc odt rtf txt xlsx csv pptx odp html. → virtual output path string |
Archive verbs
File-based compression and extraction. All paths are virtual (/root/). Operand is a single path string or an array of paths.
| Verb | Key modifiers |
COMPRESS ?paths | AS "zip"|"tar"|"tar.gz"|"tgz"|"tar.bz2"|"tbz2"|"gz" INTO "/root/out" — "gz" accepts exactly one source file. → virtual output path string |
DECOMPRESS "/root/archive" | INTO "/root/dir" — format auto-detected from file extension (.zip .tar .tar.gz .tgz .tar.bz2 .tbz2 .gz). → count of extracted files |
Database verbs
The OQL database is an in-memory relational engine (DashMap hot layer + redb persistence). All filter expressions use OQL WHERE syntax, not SQL. Default database name is "main" if FROM is omitted.
| Verb | Key modifiers / Returns |
CREATE DATABASE "name" | Create a new database. → true |
DATABASE LIST | → array of database name strings |
DELETE DATABASE "name" | Drop database and all its tables. → true |
CREATE TABLE "tbl" IN "db" | WITH COLUMN SET "col" AS TEXT|NUMBER|BOOLEAN|DATE|TIMESTAMP|UUID|ENCRYPTED|BLOB AND ... — define columns. AS FORMULA "expr" for computed columns. |
TABLE LIST "db" | → array of {name, columns} objects |
FLUSH TABLE "tbl" FROM "db" | Delete all rows, keep table structure. → true |
DELETE TABLE "tbl" IN "db" | Drop table entirely. → true |
INSERT "{"col":val}" INTO "tbl" FROM "db" | Insert a row from a JSON string. → inserted row ID number |
QUERY "tbl" FROM "db" | WHERE "col IS EQUAL TO 'val'" SORT BY "col" FORMAT "desc" LIMIT n OFFSET n → array of row objects |
UPDATE "tbl" FROM "db" | WHERE "filter" WITH "{"col":"newval"}" → count of updated rows |
PURGE "tbl" FROM "db" | [WHERE "filter"] — no WHERE purges all rows. → count of deleted rows |
Database — aggregates & analytics
| Verb | Key modifiers / Returns |
COUNT "tbl" FROM "db" | [WHERE "filter"] → row count as number |
SUM "tbl" FROM "db" | [WHERE "filter"] WITH "col" → sum of numeric column |
AVG "tbl" FROM "db" | [WHERE "filter"] WITH "col" → mean of numeric column |
MIN "tbl" FROM "db" | [WHERE "filter"] WITH "col" → minimum value of numeric column |
MAX "tbl" FROM "db" | [WHERE "filter"] WITH "col" → maximum value of numeric column |
MEDIAN "tbl" FROM "db" | [WHERE "filter"] WITH "col" → median of numeric column |
MODE "tbl" FROM "db" | [WHERE "filter"] WITH "col" → most frequent value of any column |
STDEV "tbl" FROM "db" | [WHERE "filter"] WITH "col" → population standard deviation of numeric column |
GROUP "tbl" FROM "db" BY "col" | [WHERE "filter"] [WITH "col" AS "sum|avg|min|max"] [HAVING "filter"] → array of {col, count, [op_col], rows} objects. HAVING filters on the group result. |
RANK "tbl" FROM "db" | [WHERE "filter"] WITH "col" [AS "desc"] → all rows sorted by column with a rank field (1-based) added to each |
Database — WHERE filter syntax
Used in WHERE, HAVING, and UPDATE WHERE. Combine with AND / OR.
| Expression | Meaning |
col IS EQUAL TO 'val' | Exact match (string or number) |
col IS NOT EQUAL TO 'val' | Inequality |
col IS GREATER THAN n | Numeric comparison |
col IS LESS THAN n | Numeric comparison |
col IS GREATER THAN OR EQUAL TO n | ≥ |
col IS LESS THAN OR EQUAL TO n | ≤ |
col IS BETWEEN n AND m | Inclusive range |
col IS IN 'a,b,c' | Membership — comma-separated values |
col IS NOT IN 'a,b,c' | Non-membership |
col IS LIKE 'pat%' | SQL-style wildcard — % any sequence, _ any single char. Case-insensitive. |
col IS NOT LIKE 'pat%' | Inverse wildcard match |
col IS SIMILAR TO 'pat' AS PREFIX | Starts-with match |
col IS SIMILAR TO 'pat' AS SUFFIX | Ends-with match |
col IS SIMILAR TO 'pat' AS WHOLE | Exact whole-string match |
col CONTAINS 'val' | Substring present in text, or element present in array |
col IS NULL | Field is null or absent |
col IS NOT NULL | Field has a non-null value |
Filesystem verbs
Every namespace has two virtual filesystem roots. /root/ is the primary sandbox — always available, capped at 4 GB on every tier. /mounted/ is the extended storage volume — available on Starter and above (tier total minus 4 GB); absent on Free tier. Any path not starting with /root/ or /mounted/, or that escapes via .., is rejected.
| Verb | Key modifiers |
WRITE "content" | INTO "/root/path" or INTO "/mounted/path" — creates parent directories. AS "append" to append. → virtual path string |
READ "/root/path" | AS "json" to auto-parse JSON content. Works on /mounted/ too. → text, binary, or parsed object |
LIST "/root/" | AS "recursive" for full subtree. WHERE "*.ext" to filter. Works on /mounted/ too. → array of virtual path strings |
STAT "/root/path" | → {path, is_file, is_dir, size} |
EXISTS "/root/path" | → boolean |
MKDIR "/root/dir" | Creates directory and all parents. Works on /mounted/ too. → virtual path string |
COPY "/root/a" | TO "/root/b" — AS "recursive" for directories. Cross-volume copy supported. → destination path |
MOVE "/root/a" | TO "/root/b" — cross-volume move supported. → destination path |
REMOVE "/root/path" | AS "recursive" for non-empty directories. → true |
CLEAR "/root/dir" | Delete all contents of directory; keep the directory itself. → count of deleted entries |
SEARCH "/root/" | WHERE "glob" — AS "recursive". Glob patterns: "*" all, "*.ext" by extension, "prefix*" by prefix, exact name. Works on /mounted/ too. → array of virtual path strings |
FILE SELECT "path" | AND-chain multiple paths to build an array for COMPRESS or other multi-file verbs. Paths may mix /root/ and /mounted/. → array of virtual path strings |
FILE STORAGE SIZE | → total namespace disk usage in bytes (both /root/ and /mounted/ combined) as a number |
SHARE "/root/path" | AS "24h"|"7d"|"30d"|"never" — default: no TTL. Creates public share link. Free tier: 1 active share (auto-replaces previous). Starter: 64. Pro: 128. Enterprise: 1024. Works on /mounted/ too. → https://ocalt.com/files/{token} URL |
UNSHARE "/root/path" | Revoke all share tokens for a specific path. → count revoked |
FILE SHARE LIST | → array of {url, path, expires_at} objects for all active shares in the namespace |
FILE UNSHARE ALL | Revoke all active shares for the namespace. → true |
SERVE "/root/file" | Read file and return as binary response body. API router sets Content-Type from extension. |
ENV "VAR_NAME" | Read a server-side environment variable. → text string or null |
Auth verbs
| Verb | Key modifiers / Returns |
REGISTER "username" | WITH "password" [AS "email"] → UID number or error |
LOGIN "username" | WITH "password" → {token, user_id} object or error |
LOGOUT ?token | Invalidate a single session. → boolean |
SESSION ?token | → {user_id, username, email} object or null (expired / not found) |
REFRESH ?token | Extend session expiry by 30 days. → same token string or error |
REVOKE ?user_id | Revoke all sessions for a user by numeric user_id. → count of sessions revoked |
COMPARE "plain" | WITH "hash" — constant-time bcrypt comparison. → boolean |
Cache verbs
| Verb | Description |
CACHE "value" AS "key" | Store value under key with no TTL |
CACHE "value" AS "key" ON "seconds" | Store with TTL (integer seconds as string) |
CACHE "key" SET ?var | Retrieve by key. → value or null if missing/expired |
FLUSH "key" | Delete a cache key. → boolean |
EXPIRE "key" ON "seconds" | Reset TTL on existing key. → true or null if key not found |
Network verbs
| Verb | Key modifiers |
FETCH "url" / GET "url" | HTTP GET. JSON responses auto-parsed. Non-2xx → {ok:false, status, body}. |
POST "url" | WITH ?body — object/array sent as JSON; text as plain; binary as octet-stream |
PUT "url" | WITH ?body |
DELETE "url" | — |
PING "url" | Performs a GET request. → {alive:boolean, url:string} — alive is true if the GET succeeded |
RESOLVE "hostname" | DNS lookup. → array of IP address strings |
DOWNLOAD "url" | INTO "/root/path" — saves response body to file |
UPLOAD "/root/file" | TO "url" — POSTs file binary |
CONNECT "url" | HTTP GET with 30 s timeout — designed for SSE and long-poll endpoints. Returns response body (text or parsed JSON). Not a raw TCP connection. |
HTTP control verbs
Modify the HTTP response when OQL runs in Site Mode. Return null and do not terminate the chain.
| Verb | Key modifiers |
HEADER "name" | AS "value" — append a response header |
STATUS n | Set HTTP response status code |
REDIRECT "url" | AS "301"|"302" — default 302. Sets Location header and status code. |
COOKIE "name" | AS "value" [WITH "path"] [FORMAT "expires"] — sets Set-Cookie header with Secure; SameSite=Lax |
COOKIE DELETE "name" | Sets cookie expiry to 1 Jan 1970 — removes it from the browser |
GOTO "url" | Sets 302 Location header and returns the URL string. |
Streaming verbs
| Verb | Key modifiers |
STREAM ?val | TO "channel" [FROM "namespace"] — emit event to named channel via oql-signal. → delivered count |
BROADCAST ?val | [FROM "namespace"] — emit to all connected clients in namespace. → delivered count |
SUBSCRIBE "channel" | [FROM "namespace"] — block up to 30 s for next event on channel. → event data or null on timeout |
PUBLISH ?val | TO "channel" — alias for STREAM |
Image verbs
Image verbs operate on an in-memory canvas value (binary) produced by IMAGE LOAD or RAW IMAGE CREATE. Chain operations without writing to disk until RENDER or WRITE.
| Verb | Key modifiers |
IMAGE LOAD "/root/path" | Decode image file (jpg png gif webp tiff bmp and others) into canvas binary value. |
RESIZE ?img | TO "WxH" — bilinear resampling. Width and height in pixels. |
CROP ?img | FROM "x1xY1" TO "x2xY2" — pixel rectangle; top-left origin |
ROTATE ?img | AT "90"|"180"|"270" — degrees clockwise |
FLIP ?img | USING "horizontal"|"vertical" |
FILTER ?img | USING "grayscale"|"invert"|"brighten"|"contrast"|"sepia"|"blur"|"sharpen" [WITH n] — n is intensity or pass count |
THUMBNAIL ?img | AT "WxH" — fit-within, preserving aspect ratio |
WATERMARK ?img | WITH "/root/wm.png" AT "top-left"|"top-right"|"bottom-left"|"bottom-right"|"center" — alpha-blend watermark PNG onto canvas |
COMPOSITE ?img | WITH "/root/overlay.png" — alpha-blend overlay at top-left origin |
HISTOGRAM ?img | → {r:[0..255 counts], g:[...], b:[...]} |
DRAW TEXT "text" | FROM ?img AT "XxY" USING "white"|"black"|"#rrggbb" — render text at pixel position using built-in 5×7 bitmap font. → modified canvas |
RENDER ?img | AS "PNG"|"BMP" — encode canvas to binary bytes. Default "PNG". Chain with WRITE to save. |
Audio / Video verbs
All paths are virtual (/root/). Each write verb requires INTO "/root/dst". Operations invoke FFmpeg or ffprobe as subprocesses.
| Verb | Key modifiers |
TRANSCODE "/root/src" | AS "format" INTO "/root/dst" — remux/re-encode to target container |
TRIM VIDEO "/root/src" | FROM "HH:MM:SS" TO "HH:MM:SS" INTO "/root/dst" |
TRIM AUDIO "/root/src" | FROM "HH:MM:SS" TO "HH:MM:SS" INTO "/root/dst" |
SPLICE "/root/a" | WITH "/root/b" INTO "/root/dst" — concatenate two files via stream copy |
CONCAT "/root/a" | WITH "/root/b" INTO "/root/dst" — concatenate two files via stream copy |
INSERT FRAME "/root/img" | INTO "/root/vid" AT "HH:MM:SS" FROM duration_secs TO "/root/dst" — hold image as still clip at timestamp |
INSERT CLIP "/root/clip" | INTO "/root/vid" AT "HH:MM:SS" FROM duration_secs TO "/root/dst" [USING "loop"] |
EXTRACT FRAME "/root/vid" | AT "HH:MM:SS" INTO "/root/img.png" — extract single frame as image file |
EXTRACT AUDIO "/root/vid" | INTO "/root/audio.mp3" — strip audio track as MP3 |
OVERLAY "/root/vid" | WITH "/root/asset" AT "x:y" INTO "/root/dst" — overlay image or video at coordinate |
SUBTITLE "/root/vid" | WITH "/root/sub.srt" INTO "/root/dst" — burn subtitles into video |
REPLACE AUDIO "/root/vid" | WITH "/root/audio" INTO "/root/dst" — swap entire audio track |
REPLACE FRAME "/root/vid" | WITH "/root/img" FROM "HH:MM:SS" TO "HH:MM:SS" INTO "/root/dst" — replace time range with a still image |
REPLACE CLIP "/root/vid" | WITH "/root/clip" FROM "HH:MM:SS" TO "HH:MM:SS" INTO "/root/dst" |
SPEED VIDEO "/root/vid" | WITH "2.0" INTO "/root/dst" — speed multiplier; audio tempo adjusted accordingly |
REVERSE VIDEO "/root/vid" | INTO "/root/dst" — reverses video and audio simultaneously |
MUTE VIDEO "/root/vid" | INTO "/root/dst" — removes audio track |
LOOP VIDEO "/root/vid" | WITH n INTO "/root/dst" — loop video n times total (default 2) |
SET VOLUME "/root/vid" | WITH "1.5" INTO "/root/dst" — volume multiplier |
NORMALIZE AUDIO "/root/vid" | INTO "/root/dst" — loudnorm filter |
PITCH AUDIO "/root/vid" | WITH "1.2" INTO "/root/dst" — pitch multiplier via asetrate+aresample |
MIX AUDIO "/root/a" | WITH "/root/b" INTO "/root/dst" — blend two audio streams (amix) |
FADE VIDEO "/root/vid" | AS "in"|"out" WITH "dur_secs" FROM "start_secs" INTO "/root/dst" — video and audio fade simultaneously |
FADE AUDIO "/root/vid" | AS "in"|"out" WITH "dur_secs" FROM "start_secs" INTO "/root/dst" |
SCALE VIDEO "/root/vid" | WITH "1920x1080" INTO "/root/dst" — WITH "width" auto-computes height |
STABILIZE VIDEO "/root/vid" | INTO "/root/dst" — two-pass vidstab (detect + transform) |
TEXT ON VIDEO "/root/vid" | WITH "text" AT "x:y" FROM "fontsize" AS "color" [USING "/root/font.ttf"] INTO "/root/dst" — drawtext filter with box background |
PROBE MEDIA "/root/vid" | → ffprobe JSON object: {streams, format} |
COLOR GRADE "/root/vid" | WITH "contrast=1.2:saturation=1.3:brightness=0.1:gamma=1.0" INTO "/root/dst" — FFmpeg eq filter parameters |
BLUR VIDEO "/root/vid" | WITH "radius" INTO "/root/dst" — box blur; default radius 5 |
MIRROR VIDEO "/root/vid" | AS "horizontal"|"vertical" INTO "/root/dst" |
FREEZE FRAME "/root/vid" | AT "HH:MM:SS" WITH "duration_secs" INTO "/root/dst" — insert still hold at timestamp |
GREEN SCREEN "/root/vid" | WITH "/root/bg" AS "0x00FF00" FROM "similarity" TO "blend" INTO "/root/dst" — chromakey composite |
SPLIT SCREEN "/root/a" | WITH "/root/b" AS "horizontal"|"vertical" INTO "/root/dst" — hstack or vstack |
BOOMERANG VIDEO "/root/vid" | INTO "/root/dst" — forward then reversed concatenated |
TRANSITION VIDEO "/root/a" | WITH "/root/b" FROM "crossfade_secs" INTO "/root/dst" — xfade + acrossfade |
Map verbs
Geocoding and reverse-geocoding use OpenStreetMap Nominatim (no API key required). Routing uses the OSRM public demo server. Each Nominatim request uses a randomised IP identity — no global rate limiting, no request queuing. Response time is network latency only (typically 500ms–1s).
| Verb | Key modifiers / Returns |
MAP SEARCH "query" | → array of {name, lat, lon, type, osm_id, street_number, street, suburb, city, province, postcode, country, country_code, address} |
MAP GEOCODE "address" | → {lat, lon, name} — coordinates for first result |
MAP REVERSE "lat,lon" | → {display_name, name, lat, lon, address}. Also: MAP REVERSE lat BY lon |
MAP PIN "lat,lon" | WITH "label" → {lat, lon, name} |
MAP DISTANCE "lat1,lon1" | TO "lat2,lon2" → distance in kilometres (Haversine) |
MAP BOUNDS ?places | Array of {lat,lon} objects → {min_lat, max_lat, min_lon, max_lon, center_lat, center_lon} |
MAP CLUSTER ?places | WITH "radius_km" → array of {center_lat, center_lon, count, points} |
MAP ROUTE "from" | TO "to" — geocodes both endpoints then routes via OSRM driving. → {distance_km, duration_min, from, to, from_lat, from_lon, to_lat, to_lon} |
MAP RENDER ?places | [FORMAT "street"|"satellite"|"terrain"] [WITH zoom] — places = array of {lat,lon,name}. → temporary URL to a Leaflet HTML map page |
Calendar verbs
Built-in per-namespace calendar. All verbs are prefixed with CALENDAR. Datetimes are UTC Unix timestamps. Accepted datetime input: "2026-07-01T09:00:00" or "2026-07-01".
| Verb | Key modifiers / Returns |
CALENDAR CREATE EVENT "title" | AT "start" TO "end" USING "tz" FORMAT "desc" WITH "attendees" AS "freq" ON "day" FROM "cal-id" → event object |
CALENDAR GET EVENT "id" | → event object |
CALENDAR GET EVENTS "today"|"this week"|"this month" | → array of event objects |
CALENDAR GET EVENTS FROM "date" TO "date" | [WHERE "filter"] → array of event objects |
CALENDAR GET NEXT EVENT | → next upcoming event object or null |
CALENDAR UPDATE EVENT "id" | WITH "title" FORMAT "desc" AT "start" TO "end" USING "tz" → true |
CALENDAR DELETE EVENT "id" | AS "this"|"following"|"all" — default: this occurrence. → count |
CALENDAR CREATE CALENDAR "name" | FORMAT "desc" WITH "#hex" → calendar object |
CALENDAR LIST | → array of calendar objects |
CALENDAR DELETE CALENDAR "id" | → count deleted |
CALENDAR CHECK AVAILABILITY FROM "date" TO "date" | WITH "30m" → array of {start_ts, end_ts} free slots |
CALENDAR BOOK SLOT ?slot | WITH "Name" FORMAT "email" → event object |
CALENDAR COUNT FROM "date" TO "date" | → count of events in range |
CALENDAR EXPORT "cal-id" | → iCal string (RFC 5545). Empty = all calendars. |
CALENDAR IMPORT "/root/file.ics" | → count of imported events |
Editor verbs
Document editor model. The document is a plain OQL object — open a file into a variable, manipulate with editor verbs, save back. Line and column numbers are 1-based. All verbs return the updated document object except EDITOR READ and EDITOR FIND.
| Verb | Key modifiers / Returns |
EDITOR TEXT OPEN "path" | Open or create a plain text file → document object |
EDITOR CODE OPEN "path" | Open or create a code file, auto-detect language → document object |
EDITOR READ ?doc | → full content as string |
EDITOR SAVE ?doc | INTO "/root/path" — saves to original or specified path → document object |
EDITOR INSERT AFTER ?doc | WITH "content" AT "line" → document object |
EDITOR INSERT BEFORE ?doc | WITH "content" AT "line" → document object |
EDITOR REPLACE LINE ?doc | AT "line" WITH "content" → document object |
EDITOR REPLACE RANGE ?doc | FROM "line" TO "line" AT "col" USING "col" WITH "content" → document object |
EDITOR ERASE ?doc | AT "line" → document object |
EDITOR GOTO ?doc | AT "line" USING "col" — move cursor → document object |
EDITOR SELECT ?doc | FROM "line" TO "line" AT "col" USING "col" → document object |
EDITOR FIND ?doc | WITH "pattern" — case-insensitive → array of {line, col, text} |
EDITOR COPY ?doc | Copy selection or cursor line to clipboard[0] → document object |
EDITOR CUT ?doc | Copy and remove selection or cursor line → document object |
EDITOR PASTE ?doc | AT "line" — insert clipboard[0] after line → document object |
EDITOR CLIPBOARD LIST ?doc | → array of clipboard strings (max 50) |
Browser verbs
Headless Chromium via CDP (chromiumoxide). One browser instance per namespace; launched on first use, reused thereafter.
| Verb | Key modifiers |
BROWSER OPEN "url" | [WITH "user-agent"] — launch browser if not running, navigate, wait for navigation. → true |
BROWSER NAVIGATE "url" | Navigate without waiting for load. → true |
BROWSER CLICK "selector" | CSS selector. Errors if element not found. → true |
BROWSER TYPE "selector" | WITH "text" — click element then type text. → true |
BROWSER READ "selector" | → inner HTML of element. Omit selector to read body. |
BROWSER EVALUATE "js" | Execute JavaScript in page context. → string, number, or boolean result |
BROWSER SCREENSHOT "/root/out.png" | Save full-page PNG screenshot. → file path string |
BROWSER SCROLL "x,y" | Call window.scrollBy(x, y). → true |
BROWSER WAIT n | Sleep for n seconds. → true |
BROWSER BACK | history.back(). → true |
BROWSER FORWARD | history.forward(). → true |
BROWSER RELOAD | Reload the current page. → true |
BROWSER COOKIES | → array of {name, value, domain} objects |
BROWSER TAB NEXT | Dispatch Tab keydown event on focused element. → true |
BROWSER TAB PREV | Dispatch Shift+Tab keydown event on focused element. → true |
BROWSER FOCUS CHECK | [AS "id"|"name"|"class"] → attribute value of currently focused element. Default attribute: "id". |
BROWSER CLOSE | Terminate browser process for this namespace. → true |
IMAP / Mail verbs
Requires an active session established by the IMAP connect verb. SMTP sending derives host from IMAP host by replacing imap. with smtp..
| Verb | Key modifiers / Returns |
IMAP "imap.host.com" | WITH "password" AS "user@host.com" — establish TLS session (default port 993). → true or error |
MAIL INBOX | → array of up to 20 most recent messages: {uid, subject, from, to, date, body} |
MAIL UNREAD | → array of unseen message objects |
MAIL SEARCH "criteria" | IMAP SEARCH criteria string (e.g. "FROM boss@co.com") → array of message objects |
MAIL "uid" | Fetch full message by UID → single message object including body |
MAIL SEND | TO "address" WITH "subject" AS "body" — SMTP STARTTLS. → true or error |
MAIL CLOSE | Clear stored IMAP session for this namespace. → true |
Notification verbs
| Verb | Key modifiers / Returns |
EMAIL "body" | TO "address" WITH "subject" — sends via accounts bridge. HTML body auto-detected by leading <. → true or error |
NOTIFY "body" | TO "userid" WITH "title" — Web Push via VAPID. → count of subscriptions delivered to |
WEBHOOK ?data | AT "url" — HTTP POST of operand as JSON. → response |
SMS "body" | SMS provider not configured — always returns error |
Push subscription verbs
| Verb | Key modifiers |
PUSH SUBSCRIBE ?subscription_json AS "key" | Store a browser Web Push subscription object under "key" for this namespace. → true |
PUSH UNSUBSCRIBE "key" | Remove stored push subscription by key. → true |
OCR
| Verb | Key modifiers |
OCR "/root/image.png" | [AS "lang"] — Tesseract OCR. Default language "eng". Accepts /root/ paths or https:// URLs (downloaded to temp file). → extracted text string |
DNS
| Verb | Key modifiers |
DNS "domain" | [AS "A"|"AAAA"|"MX"|"TXT"|"CNAME"|"NS"|"SOA"|"ALL"] — default "A". Uses system dig. → array of {name, ttl, type, value} objects |
EXEC
| Verb | Key modifiers |
EXEC "command arg1 arg2" | Run a shell command via the system shell. → {exit_code, stdout, stderr, success} |
WebRTC verbs
Signaling via oql-signal at 127.0.0.1:3002. Media is peer-to-peer and never touches the server. TURN/STUN hosted on the OQL server.
| Verb | Key modifiers / Returns |
RTC CREDENTIALS | [AS "ttl_seconds"] — HMAC-SHA1 time-limited TURN credentials. Default TTL 3600 s. → {ice_servers:[{urls, username, credential}], ttl} |
RTC OFFER ?sdp | AT "room" — signal offer SDP to room. → true |
RTC ANSWER ?sdp | AT "room" — signal answer SDP to room. → true |
RTC ICE ?candidate | AT "room" — signal ICE candidate to room. → true |
RTC JOIN "room" | → array of peer strings currently in room |
RTC LEAVE "room" | → true |
GeoIP
MaxMind GeoLite2-City database. Client IP derived from the incoming request context in Site Mode.
| Operand | Returns |
EMIT GEOIP ADDRESS | Client IP address string |
EMIT GEOIP CITY | City name string |
EMIT GEOIP COUNTRY | Country name string |
EMIT GEOIP REGION | State/province name string |
EMIT GEOIP LAT | Latitude number |
EMIT GEOIP LON | Longitude number |
EMIT GEOIP ALL | {ip, city, country, region, lat, lon} object for client IP |
EMIT GEOIP "1.2.3.4" | {ip, city, country, region, lat, lon} object for the specified IP address |
Weather & Currency
| Verb | Key modifiers / Returns |
WEATHER "location" | [FORMAT "metric"|"imperial"] — wttr.in backend. → {location, description, temp_c, temp_f, feels_like_c, feels_like_f, humidity, wind_kph, wind_mph, precip_mm, cloud_cover, visibility_km, uv_index, unit} |
CURRENCY FROM "USD" TO "ZAR" | Frankfurter API. Single target → {from, to, rate, date}. Multiple targets comma-separated in TO ("ZAR,EUR,GBP") → array of rate objects. |
Delay & Schedule
| Verb | Key modifiers |
DELAY "5s" | Pause execution. Accepts: "Nms" milliseconds, "Ns" seconds, "Nm" minutes, "Nh" hours, "Nd" days, or bare integer seconds. |
SCHEDULE AT "timestamp" | Pause until Unix timestamp or ISO-8601 datetime string. No-op if timestamp is in the past. |
CRON
| Statement | Description |
DEFINE CRON "name" ON "expression" OPEN NEST ... CLOSE NEST | Register a persistent cron job. Expression: standard 5-field cron ("*/5 * * * *"). Body executes on schedule in background. Replaces an existing job with the same name. |
CRON LIST SET ?arr | → array of {name, expression, status, next_run, last_run} |
CRON DESCRIBE "name" SET ?job | → single job object or null |
CRON DELETE "name" | → true |
WATCH
| Statement | Description |
WATCH "source" [ON "event"] [AS "name"] OPEN NEST ... CLOSE NEST [SET ?id] | Register an event handler. Source formats: "fs:/root/uploads" (filesystem), "weather:London", "currency:USD/ZAR". Events: "create"|"modify"|"delete"|"change". Handler body runs in background on trigger. !EVENT(key) accesses event data inside the body. → handler name string |
LIST WATCHES SET ?arr | → array of {name, source, event} objects |
DELETE WATCH "name" | → boolean — true if found and removed |
GATHER
Suspends query execution, renders an HTML form to the client, and resumes after submission. Field values are bound to OQL variables and available to subsequent steps.
| Component | Description |
GATHER [WITH "title"] [CLASS "css-class"] OPEN NEST ... CLOSE NEST | Outer block. WITH sets form heading. CLASS overrides default .oql-gather CSS class. |
?var TEXT [WITH "label"] [PLACEHOLDER "text"] | Text input |
?var NUMBER | Number input |
?var BOOLEAN | Checkbox |
?var DATE | Date picker |
?var TIMESTAMP | Datetime-local picker |
?var BLOB | File upload |
?var TEXTAREA | Multi-line textarea |
?var RANGE | Slider with live value display |
?var COLOR | Color picker |
?var HIDDEN [PLACEHOLDER "preset"] | Hidden field with preset value |
?var SELECT OPTIONS "a" AND "b" AND "c" | Dropdown select |
?var RADIO OPTIONS "a" AND "b" AND "c" | Radio button group |
FORMAT EMAIL|PHONE|URL|DATE|TIME|DATETIME | Input type override + browser validation |
FORMAT MINIMUM n TO MAXIMUM n | min/max for NUMBER and RANGE |
FORMAT LENGTH MINIMUM n TO MAXIMUM n | minlength/maxlength for TEXT and TEXTAREA |
FORMAT REGEX "pattern" | HTML pattern attribute |
FORMAT REQUIRED | Required marker and validation |
TO TABLE "name" WITH COLUMN "col" SET ?var AND ... | Auto-insert submitted values into a database table after resume |
Browser inputs: LOCATION CAMERA MICROPHONE FILE DEVICE | Request browser API data (geolocation, camera, microphone, file picker, device info) |
CONFIRM
| Statement | Description |
CONFIRM "message" AFTER ... OR ... | Suspends execution and renders a Confirm/Cancel UI to the client. The AFTER chain executes on approval; the OR chain executes on rejection. Stored in AppState with 24 h timeout. Typical pattern: CONFIRM "Are you sure?" AFTER do_thing SET ?result OR EMIT "Cancelled" |
WEBASSEMBLY / ENTER / GRANT
| Statement | Description |
GRANT WEBASSEMBLY ?var AS "alias" | Expose OQL variable ?var inside the next WEBASSEMBLY block as oql_get("alias"). Grants are cleared after the WEBASSEMBLY block executes and its SET binding is applied. |
WEBASSEMBLY AS "js" OPEN NEST ... CLOSE NEST SET ?result | Execute JavaScript in a bubblewrap-isolated Node.js sandbox. A return statement sets the result. Access granted OQL vars via oql_get("alias"). |
WEBASSEMBLY AS "python" OPEN NEST ... CLOSE NEST SET ?result | Execute Python 3 in a bubblewrap-isolated sandbox. stdout at process exit becomes the result string. |
WEBASSEMBLY AS "wasm" OPEN NEST ... CLOSE NEST SET ?result | Execute a compiled WASM binary at the path given inside the block via wasmtime with WASI filesystem access scoped to /root/. |
ENTER "expression" SET ?var | Sub-statement inside a WEBASSEMBLY block. Evaluates a named expression or function call from the block code and binds the result to ?var. Multiple ENTER lines supported. |
INCLUDE / SIDELOAD
| Statement | Description |
INCLUDE "/root/file.oql" [SET ?result] | Load and execute OQL code from a namespace filesystem file. Shares current scope. |
INCLUDE "https://url" [SET ?result] | Fetch OQL code from a URL and execute it. Shares current scope. |
SIDELOAD ?code_string [SET ?result] | Parse and execute an OQL code string from a variable. Shares current scope. Useful for dynamic query construction. |
RAW IMAGE
Pixel-level image construction. Coordinate system: 1-based column BY row, top-left origin. All unspecified channels default to 0.
| Statement | Description |
RAW IMAGE CREATE w BY h OPEN NEST PIXEL x BY y IS RED n AND GREEN n AND BLUE n AND OPACITY n% ... CLOSE NEST SET ?img | Construct a canvas pixel by pixel. Each PIXEL statement sets one pixel. Channel values 0–255; OPACITY accepts 0–100% (converted to 0–255 alpha). Returns binary canvas value. |
RENDER ?img AS "PNG"|"BMP" | Encode canvas binary to PNG or BMP bytes. Default "PNG". Chain with WRITE to save to file. |
DOC CREATE
| Statement | Description |
DOC CREATE FROM "url" AS "pdf"|"docx" SET ?path | Fetch URL content and convert to PDF or DOCX via LibreOffice. → virtual path under /root/files/ |
DOC CREATE FROM "html string" AS "pdf"|"docx" SET ?path | Convert an HTML string directly. → virtual path under /root/files/ |
HTML block
| Syntax | Description |
HTML "tag" [CLASS "a" AND CLASS "b"] [ID "id"] [ATTR "name" VALUE "val"] OPEN NEST ... CLOSE NEST [SET ?html] | Build an HTML element tree. EMIT inside the block appends to the element body. Multiple CLASS declarations are joined with a space. Returns completed HTML string. |
Email block
| Syntax | Description |
EMAIL TO "address" WITH "subject" OPEN NEST ... CLOSE NEST [SET ?ok] | Render email body from block content. EMIT inside the block appends to the body buffer. HTML auto-detected from leading <. Sends via accounts bridge on CLOSE NEST. → true or error |
USER DEVICE
| Statement | Description |
USER DEVICE [LOCATION] [CAMERA] SET ?data | Suspends execution, injects JavaScript to collect device info, resumes when data is posted back. ?data → {width, height, platform, language, online, user_agent, lat, lon, accuracy, camera_available, touch_enabled, pixel_ratio, timezone}. LOCATION requests geolocation permission; CAMERA checks camera device availability. Timeout: 300 s. |
REMEMBER / RECALL / FORGET / LIST REFS
Persistent cross-query key–value store scoped to the namespace, backed by SQLite. Values survive query restarts and deployments.
| Verb | Key modifiers / Returns |
REMEMBER ?val AS "name" | Store value persistently under "name". Overwrites if exists. → value (passthrough) |
RECALL "name" | → stored value string or null |
FORGET "name" | Delete stored value. → true |
LIST REFS | → array of {name, value} objects ordered by name |
Domain verbs
| Verb | Key modifiers / Returns |
DOMAIN LIST | → array of {subdomain, url, is_default} objects for this namespace |
DOMAIN SEARCH "prefix" | Minimum 5 characters. → array of {subdomain, url, available} objects |
DOMAIN ADD "subdomain" | Add extra subdomain. Tier limits: Starter 2, Pro 7, Enterprise 20. Free cannot add. → https://subdomain.ocalt.site URL or error |
DOMAIN REMOVE "subdomain" | → true or error |
Audio / Video bridge
Server-managed WebRTC room allocation. Media is peer-to-peer; the server only coordinates signaling slots. Peer count limit varies by tier.
| Statement | Description |
NEW AUDIO BRIDGE n PEERS SET ?room | Allocate an audio-only WebRTC room with n peer slots. → {room_id, type:"audio", expires, peers:[{slot, join_url}]} |
NEW VIDEO BRIDGE n PEERS SET ?room | Allocate a video+audio WebRTC room. Same return shape. Peer limit by tier: Free 2, Starter 1, Pro 10, Enterprise unlimited. |
System variables
| Variable | Description |
!NOW | Unix timestamp (seconds) at query start — fixed for the entire query duration |
!INDEX | 0-based iteration index inside FOREACH |
!VALUE | Current item inside FOREACH |
!STATE(IF) | Boolean result of last IF condition; match count when used with IF SOME |
!STATE(WHILE) | Boolean result of last WHILE condition; match count with WHILE SOME |
!STATE(FOREACH) | FOREACH iteration count (same as !INDEX + 1) |
!REQUEST(path) | URL path (Site Mode) |
!REQUEST(method) | HTTP method (Site Mode) |
!REQUEST(body) | Raw request body (Site Mode) |
!REQUEST(param:name) | Query string parameter (Site Mode) |
!REQUEST(form:field) | Form POST field (Site Mode) |
!REQUEST(header:name) | Request header value (Site Mode) |
!GET(name) | Alias: !REQUEST(param:name) |
!POST(field) | Alias: !REQUEST(form:field) |
!COOKIE(name) | Cookie value (Site Mode) |
!EVENT(key) | Event data field inside a WATCH handler body |
ONBROWSER [pending]
Browser-side OQL execution context. Runs inside a compiled WASM OQL runtime in the user's browser. Standard non-I/O verbs are legal inside. See ONBROWSER docs →
| Verb | Description |
ONBROWSER SELECT "css" SET ?el | querySelector — first match |
ONBROWSER ALL SELECT "css" SET ?els | querySelectorAll — all matches |
ONBROWSER ?el INNERHTML "html" | Set innerHTML on element |
ONBROWSER ?el INNERTEXT "text" | Set innerText on element |
ONBROWSER ?el CLASS ADD|REMOVE|RESET "cls" | classList manipulation |
ONBROWSER ?el ATTRIBUTE ADD|REMOVE|UPDATE "attr" [WITH "val"] | Attribute manipulation |
ONBROWSER ?el STYLE "cssText" | Merge full cssText string |
ONBROWSER ?el STYLE PROPERTY "val" | Set individual CSS property |
ONBROWSER !window("prop") SET ?var | Read window property |
ONBROWSER !window("prop") AS "val" | Set window property |
ONBROWSER NAVIGATE "url" | Navigate browser |
ONBROWSER HASH "hash" | Set location.hash |
ONBROWSER RELOAD | Reload page |
ONBROWSER NEW OPERATION AS "name" OPEN NEST ... CLOSE NEST | Define client-side operation |
ONBROWSER EXECUTE "name" | Execute client-side operation |
ONBROWSER ?el ONCLICK|ONCHANGE|ONSUBMIT EXECUTE "name" WITH !this AND !event | Bind operation to DOM event |
UX Components [pending]
Pre-composed styled HTML UI components. See UX docs →
| Verb | Description |
UX STYLESHEET SET ?css | Returns stylesheet link tag. Auto-injected on first use. |
UX HEADER WITH ... SET ?html | Site header with logo, title, username |
UX HERO WITH ... SET ?html | Hero banner with headline, body, CTA |
UX FOOTER WITH "copy" AS "copy" SET ?html | Site footer |
UX PANEL WITH ... SET ?html | Navigation panel |
UX FEED WITH ?items AS "items" SET ?html | Content feed |
UX POST TILE ?item AS "card"|"compact"|"feature" SET ?html | Single post tile |
UX ANIMATE ?el AS "fade-in"|"slide-up"|"pulse"|"spin" SET ?html | CSS animation wrapper |
GRAPH [pending]
SVG chart generation from data. Output is a pure <svg> element. See GRAPH docs →
| Verb | Description |
GRAPH TYPE "type" WITH ?data [TITLE "t"] [FORMAT w BY h] [THEME "t"] [WHERE X IS "x" AND Y IS "y"] SET ?svg | Generate SVG chart. All modifiers optional. Inline key/value WITH for simple types. → SVG string |
PRESENTATION [pending]
Build PPTX files from verbs. See PRESENTATION docs →
| Verb | Description |
PRESENTATION INTO "/root/deck.pptx" OPEN NEST SLIDE ... CLOSE NEST SET ?file | Build and save a PPTX presentation |
SLIDE LAYOUT "type" [DURATION "3s"] OPEN NEST ... CLOSE NEST | Define a slide. DURATION enables auto-advance for that slide. |
RICH [pending — deferred session]
RTF document construction. A4 or 16:9. LibreOffice for export. See RICH docs →
| Verb | Description |
RICH NEW AS "A4"|"16:9" SET ?doc | Create new blank document |
RICH OPEN "/root/path.rtf" SET ?doc | Open existing RTF file |
RICH INSERT ?doc WITH "content" AS "type" AT ... SET ?doc | Insert element (heading, paragraph, image, table, chart, shape, divider) |
RICH FORMAT ?doc FROM LINE n COL n TO LINE n COL n ... SET ?doc | Format text range |
RICH SAVE ?doc [INTO "/root/path"] SET ?doc | Save document |
RICH EXPORT ?doc AS "pdf"|"docx"|"pptx"|"html" INTO "/root/path" SET ?path | Export to target format via LibreOffice |
APPLICATE [pending]
Package apps for any platform from a source folder. See APPLICATE docs →
| Verb | Description |
APPLICATE TYPE "target" FROM "/root/folder/" TO "/root/out" [SIGN WITH "key"] [AS "bundle.id"] [TITLE "Name"] SET ?file | Package source folder as native app. Targets: android/apk, android/aab, windows/exe, windows/installer, macos/app, ios/app, linux/app, linux/appimage, linux/deb, linux/rpm, web/pwa. Omit SIGN WITH to use Ocalt default signer. |
DIRECTIVE [pending]
Execute OQL on a registered remote machine via the oql-client agent. See DIRECTIVE docs →
| Verb | Description |
DIRECTIVE "machine-id" OPEN NEST ... CLOSE NEST SET ?result | Run OQL block on remote agent. No inbound ports required. |
DIRECTIVE LIST SET ?agents | → array of registered agent objects |
DIRECTIVE STATUS "id" SET ?status | → agent status object |
Push subscription verbs — updated
| Verb | Description |
NOTIFY CHECK PUSH STATUS FOR ?uid SET ?bool | Check if user has an active push subscription — returns boolean |
NOTIFY REQUEST PUSH GRANT FOR ?uid WITH "return_url" | Redirect browser to notifications.ocalt.com consent portal. On grant, redirects to return_url. |
PUSH SUBSCRIBE ?sub AS ?uid SET ?ok | Store push subscription for user identifier |
PUSH UNSUBSCRIBE ?uid SET ?n | Remove all subscriptions for user identifier |
Calendar — new modifiers
| Modifier | Description |
LOCATION "string" | Event location — available on CREATE EVENT |
REMIND "15m"|"1h"|"2d" | Reminder timing before event start — available on CREATE EVENT |
ON TRIGGER OPEN NEST ... CLOSE NEST | OQL block executed when the reminder fires — available on CREATE EVENT |
SSH [pending]
Execute commands on remote machines over SSH. Replaces EXEC/SPAWN/KILL in standard OQL. See SSH docs →
| Verb | Description |
SSH "user" AT "host" PASSWORD "pass" ENTER `cmd` SET ?r | Single command via password. Default port 22. → {stdout, stderr, exit_code} |
SSH "user" AT "host" KEY "/root/key" ENTER `cmd` SET ?r | Single command via key auth. |
SSH "user" AT "host" [auth] ON "port" ENTER `cmd` SET ?r | Custom port. |
SSH "user" AT "host" [auth] OPEN NEST ENTER `...` AFTER ENTER `...` CLOSE NEST SET ?r | Multi-command block. |
SSH "user" AT "host" [auth] UPLOAD "/root/src" TO "/remote/dst" | OQL storage → remote machine. |
SSH "user" AT "host" [auth] DOWNLOAD "/remote/src" INTO "/mounted/dst" SET ?path | Remote machine → OQL storage. |
TUNNEL [pending]
Peer-to-peer data/file transfer between any two endpoints. Chunked. See TUNNEL docs →
| Verb | Description |
NEW TUNNEL SET ?room | Allocate tunnel room. Must be outside DIRECTIVE. → room object |
TUNNEL SEND "path"|"rtsp://url" TO ?room | Join as sender. Legal inside DIRECTIVE. |
TUNNEL RECEIVE ?room INTO "/mounted/path" SET ?path | Join as receiver. Writes to OQL storage. |
TUNNEL CLOSE ?room | Explicitly close tunnel room. |
TRANSCODE
FFmpeg-powered media conversion. RTSP is a first-class input source. See TRANSCODE docs →
| Verb | Description |
TRANSCODE "source" AS "format" INTO "/mounted/out" SET ?path | Convert media. Source: file path, RTSP URL, HTTP stream URL, TUNNEL room, bridge peer URL. → virtual path |
CHAT [pending — needs refinement]
Built-in chat rooms with named peers, auto-timestamped messages, message IDs and delivery status. See CHAT docs →
| Verb | Description |
CHAT WITH "n" PEERS "alias1" AND "alias2" ... SET ?room | Create chat room with named peers. → room object |
CHAT ENTRY FROM "alias" MESSAGE `text` TO ?room SET ?msg | Send message. Auto-timestamps. → message object {id, from, message, timestamp, status, room_id} |
REDIRECT
HTTP redirect response. See REDIRECT docs →
| Verb | Description |
REDIRECT "url" | 302 redirect. AS omitted defaults to 302. |
REDIRECT "url" AS "301"|"302" | Permanent or temporary redirect. |
EXEC / SPAWN / KILL — directive-only
| Verb | Description |
EXEC "command" [WITH "stdin"] SET ?r | Run shell command on target machine. → {stdout, stderr, exit_code}. Error if called outside DIRECTIVE. |
SPAWN "command" SET ?pid | Start background process on target machine. → PID. Error if called outside DIRECTIVE. |
KILL ?pid SET ?ok | SIGTERM process on target machine. → boolean. Error if called outside DIRECTIVE. |