Verb Reference
Every verb in OcaltQL, organized by section. Each entry links conceptually back to its full tutorial page for worked examples — this page is the compact reference, not a replacement for those pages.
Jump to a section:
- Getting Started
- OcaltQL Web
- OcaltQL Filesystem
- OcaltQL Database
- OcaltQL Services
- OcaltQL Advanced
- Conditions, Loops & Operators
- Execution States
- Math & CALCULATE
- Strings
- Arrays, Objects & Multiarrays
- Date & Time
- Convert & Cast
- Crypto & Compute
- HTTP, Network & Sockets
- Image Processing
- Media (Video & Audio) Processing
- Mail & Mailbox Management
- Cache, Remember & Timing
Getting Started
| Verb | Description |
|---|---|
[CHAIN] [SUBJECT] VERB [MODE] [ARGS] [PREPOSITION TARGET] [SET ?var] | The general statement grammar every OcaltQL line follows |
EMIT "text" | Output a value or literal |
STRING "value" SET ?var | Declare a string variable |
NUMBER n SET ?var | Declare a number variable |
SET ?var AS value | Generic assignment form |
SET ?var2 AS ?var1 | Copy a variable to another variable |
VARIABLE ?var1 SET ?var2 | Copy a variable — alternate form |
UNSET ?var | Destroy a variable entirely |
IF ?var IS SET | Check whether a variable currently exists |
AND | Chain — parallel branches, random resolution if multiple SET the same var |
AFTER | Chain — sequential, waits for prior statement(s) |
OR | Chain — fallback when the preceding statement fails/returns false/null |
COLLAPSE ?multivar SET ?arr | Convert a multivariable into an ordered array |
CATCH ERROR SET ?err | Capture the error from a failed statement without stopping the chain |
WARNING state | A syntactically legal but risky statement (e.g. an UPDATE with no WHERE) — executes, but is flagged distinct from FATAL |
!ERROR('message')/'code' | Read fields of the most recent caught error |
!THIS('state') | Inside a block, true/false — whether this branch executed |
!THIS('some') | Inside an IF SOME/ARE block, the matching indices/keys |
SWITCH ?var OPEN CASE ... DEFAULT ... CLOSE | Multi-branch dispatch, BREAK per case, fallthrough if BREAK omitted |
BREAK | Exit a LOOP/WHILE or SWITCH CASE early |
CONTINUE | Skip to the next LOOP/WHILE iteration |
EXIT | End the script immediately |
EXIT n | End the script, setting HTTP status n |
NEW OPERATION name WITH ?params OPEN...CLOSE | Define a reusable operation |
NEW PERSISTENT OPERATION name ... / RUN PERSISTENT name | Register an operation across executions, and call it from a later script |
RUN name WITH args SET ?result | Execute a defined operation |
RETURN value | Return a value from an operation, ending it immediately |
INCLUDE "path or url" | Execute another script file, sharing scope, capturing its top-level RETURN |
SIDELOAD "code string" | Execute a string of OQL as code, sharing scope |
START SESSION / KILL SESSION | Open/destroy server-side session state |
SET "key" AS value OF !SESSION | Write a session value |
EMIT !SESSION('key') | Read a session value |
COOKIE SET/GET/REMOVE | Client-side cookie management, with PATH/EXPIRES/DOMAIN/SECURE/HTTPONLY |
HEADER "name" AS "value" | Set an HTTP response header |
!POST / !GET / !REQUEST | Read POST/GET/merged request data — Site Mode, or opt-in via the API |
!FILES('field') | Web-accessible URL of an uploaded file |
!SERVER('KEY') | Server/environment variables — real keys include HTTP_HOST, REQUEST_METHOD, REMOTE_ADDR |
!COOKIE('name') / !SESSION('key') | Read cookie/session values as globals |
!ENV('NAME') | Read a system environment variable |
!GLOBALS('CATEGORY')('key') | Full request context by category |
!NOW('unit') | Current server datetime component |
!QUERY | The OcaltQL script currently being executed, as submitted |
!THAT | Auto-updating global — result of the most recently completed statement |
OcaltQL Web
| Verb | Description |
|---|---|
NEW HTML SET ?html OPEN...CLOSE | Build a native HTML document tree |
HTML "tag" ATTR "name" WITH "value" | Create an element with attributes |
HTML "tag" TEXT "content" | Create an element with text content |
HTML TEXT NODE "text" | Insert a raw text node |
NEW HTML NODE SET ?node OPEN...CLOSE | Build a detached node for later insertion |
HTML APPEND ?node TO ?html | Append a node to a document |
HTML APPEND ?node INTO ?html WHERE ID "x" | Insert at a specific element by ID |
HTML APPEND ?node INTO ?html WHERE TAG "x" | Insert at the first matching tag |
HTML REVERSE ?html SET ?oql | Parse raw HTML/fetched markup into OQL's native node form |
HTML GET ".selector" SET ?el | Select a single element (querySelector) |
HTML GET ALL ".selector" SET ?elarray | Select every matching element (querySelectorAll) |
HTML "script" TEXT `code` | Embed raw inline JavaScript |
HTML "script" SRC "url" | Include an external script |
ONBROWSER JAVASCRIPT ONLOAD|ONPAGESHOW|ONFOCUS|... ENTER `code` | Bind a page-level browser event by its real name, event object in scope |
ONBROWSER JAVASCRIPT ONLOADED ENTER `code` | First pageshow only — does not re-run on a back/forward cache restore |
ONBROWSER JAVASCRIPT ?el ONCLICK|ONFOCUS ENTER `code` | Bind an event to a specific element, or to every element in an array |
NEW ONBROWSER AJAX TO SELF NAMED "fn" ON SUCCESS `code` SET ?script | Generate a credential-free AJAX function calling back into the current Site Mode script |
UX TYPE "name" WITH ?data STYLE THEME FORMAT ICONS COLOR ID SET ?node | Generate an interface component as a native HTML node — 45 types, see OcaltQL UX Components |
UX ICON "name" SIZE COLOR STROKE STYLE SET ?svg / UX ICONS "set" SET ?names | One icon as pure SVG, or every name in an icon set |
UX ?c ANIMATE ENTER|EXIT|EMPHASIS "type" DELAY DURATION | Attach motion — same vocabulary as Presentations & Animations |
UX ?c TRANSITION FROM "state" TO "state" STYLE DURATION / UX ?c STATE "name" | Movement between named states, and the initial state |
UX ?c STATES SET ?arr / UX MANIFEST SET ?m | Declared states of one component, or every component generated this execution |
NEW ONBROWSER AJAX TO "/path" NAMED "fn" ON SUCCESS `code` [ON ERROR `code`] SET ?script | Same, targeting a different page on the same site — result holds the response body |
GATHER STRING|NUMBER|DATE|EMAIL|REGEX LABEL "..." SET ?var | Halt-and-resume popup collecting one input value |
GATHER STRING LENGTH MIN n MAX n | String length constraint |
GATHER NUMBER VALUE MIN n MAX n | Number range constraint |
GATHER DATE RANGE MIN "date" MAX "date" | Date range constraint |
GATHER ... AND GATHER ... | Combine multiple fields into one popup |
GATHER ... AFTER GATHER ... | Sequential, separate popups |
... OR GATHER ... | GATHER as a fallback when an existing value is missing/invalid |
CONFIRM BOOLEAN LABEL "..." SET ?bool | Halt-and-resume yes/no popup |
USER DEVICE LABEL "..." SET ?device | Request every permission and device property at once |
USER DEVICE CAMERA|MICROPHONE|GEOLOCATION|PUSH|CLIPBOARD_READ|CLIPBOARD_WRITE | Request a single named permission |
USER DEVICE SCREENSHOT | Real screen/window/tab capture via native browser picker — returns captured content, not just a status |
USER DEVICE PERMISSIONLESS | Silently collect only free device properties, no popup |
USER DEVICE PERMISSIONS | Request all six status-based permissions together, no screenshot |
NEW SYNC CHANNEL SET ?channel | Open a real-time WebSocket relay channel |
SYNC CHANNEL ?channel SEND ?payload | Push data to the browser with no incoming request |
SYNC CHANNEL ?channel RECEIVE SET ?data | Non-blocking read of the next queued message, or null |
SYNC CHANNEL ?channel CLOSE | Close a channel |
OcaltQL Filesystem
| Verb | Description |
|---|---|
FILE WRITE "content" TO "path" [BASE64] | Write a file. A bytes value needs no modifier — it is already binary. BASE64 is for when the script holds base64 text and wants the decoded bytes on disk |
FILE READ "path" SET ?content | Read a file |
FILE EXISTS "path" SET ?bool | Check existence |
FILE STAT "path" SET ?info | File metadata |
FILE LIST "path" SET ?items | Directory listing |
FILE MKDIR "path" | Create a directory |
FILE MOVE "from" TO "to" | Move/rename a file |
FILE COPY "from" TO "to" | Copy a file |
FILE DELETE "path" | Delete a file |
STORAGE USAGE SET ?info | Namespace storage usage |
FTP CONNECT "host" [ON "port"] AS "user" WITH "password"|KEY "path" [SECURE] SET ?conn | Connect to an FTP, FTPS or SFTP server |
FTP ?conn LIST/STAT/UPLOAD/DOWNLOAD/MKDIR/MOVE/DELETE/CLOSE | Operate on the remote server — see FTP & External Storage |
FTP ?src TRANSFER "path" TO ?dst "path" SET ?anchor / FTP STATUS ?anchor | Server-to-server transfer, non-blocking |
EXTERNAL BIND FTP ?conn SET ?status | Bind a server as /external — a namespace location alongside /root and /mounted |
FILE SELECT "a" AND "b" SET ?selarray | Select multiple paths for batch operations |
FILE SELECT ALL "folder" SET ?selarray | Select every item in a folder |
FILE SELECTION ?selarray COPY/DELETE TO "path" | Batch operate on a selection |
FILE COMPRESS ZIP|TAR ?selarray TO "path" | Archive a selection |
FILE SHARE "path" SET ?url | Generate a public share URL |
FILE SHARE LIST SET ?arr / FILE UNSHARE "path"/ALL | Manage active shares |
OcaltQL Database
| Verb | Description |
|---|---|
NEW DB "name" / DROP DB "name" | Create/destroy a database |
NEW TABLE "name" IN DB "db" COLUMNS ADD ... | Define a table — TYPE STRING/NUMBER/DATE, LENGTH, PRIMARY, AUTOINCREMENT, UNIQUE, REQUIRED, DEFAULT, AUTOTIMESTAMP, AUTOUPDATED |
FLUSH TABLE "name" FROM DB "db" | Empty a table, keep its schema |
DROP TABLE "name" FROM DB "db" | Delete a table entirely |
INSERT INTO DB "db" TABLE "t" ROW "col" AS val AND ... SET ?id | Insert a row |
SELECT ROWS FROM DB "db" TABLE "t" WHERE ... ORDER BY ... LIMIT n SET ?rows | Query rows |
WHERE "col" IS GREATER/LESS THAN, IS EQUAL/IDENTICAL TO, IS PREFIX SIMILAR TO, IS NOT EMPTY | WHERE clause conditions |
WHERE ... AND ... | Combine multiple WHERE conditions |
UPDATE ROWS FROM DB "db" TABLE "t" WHERE ... SET "col" AS val AND ... | Update matching rows |
DELETE ROW/ROWS FROM DB "db" TABLE "t" WHERE ... | Delete matching row(s) |
COUNT ROWS FROM DB "db" TABLE "t" WHERE ... SET ?n | Count matching rows |
GROUP BY "col" FROM DB "db" TABLE "t" SET ?grouped | Group rows by column value |
JOIN SELECT DB "db" TABLES "a" AND "b" WHERE ... SET ?results | Inner join |
JOIN LEFT SELECT DB "db" TABLES "a" AND "b" WHERE ... SET ?results | Left join |
OcaltQL Services
| Verb | Description |
|---|---|
OCR "url or path" AS "lang" SET ?text | Extract text from an image/PDF via OCR |
MAP GEOCODE "address" LIMIT n COUNTRY "cc" BOUNDS ?box SET ?loc | Address to coordinates |
MAP REVERSE "lat,lon" DETAIL "level" SET ?addr | Coordinates to address |
MAP BOUNDARY "place" SET ?shape | Administrative region polygon |
MAP SEARCH "query" BOUNDS ?box SET ?places | Points-of-interest search |
MAP POINT LAT n LON n LABEL "..." ICON "..." POPUP "..." SET ?point | Build a map point |
MAP LINE ?points SET ?line / MAP POLYGON ?points SET ?poly / MAP CIRCLE LAT n LON n RADIUS n UNIT "km" | Build map shapes |
MAP RENDER ?points LINES/POLYGONS/CIRCLES/HEATMAP ZOOM n STYLE "..." AUTOFIT SET ?url | Compose and render a full map |
MAP ROUTE "from" TO "to" VIA "waypoint" PROFILE "mode" ALTERNATIVES SET ?route | Driving/cycling/walking directions |
MAP MATRIX ?points SET ?table | Many-to-many distance/duration matrix |
MAP SNAP LAT n LON n SET ?snapped | Snap a point to the nearest road |
MAP DISTANCE "a" TO "b" SET ?km | Straight-line (Haversine) distance |
MAP CLUSTER ?places SET ?clusters / MAP BOUNDS ?places SET ?bounds | Cluster points / bounding box |
GRAPH TYPE "type" WITH ?data TITLE FORMAT THEME AXIS SET ?svg | Native SVG chart — 40+ types, see Graphs - SVG Charts for the full catalog |
GRAPH OPEN "chart.svg" SET ?svg | Read a saved chart back into the same native node value |
GRAPHIC ?img SELECT LASSO POINTS "x,y x,y ..." | Freeform selection defined by a list of coordinate points |
GRAPHIC ?img SELECT COLOR ?color TOLERANCE n | Select all pixels within n of a sampled color |
DOC CREATE FROM STRING/URL AS "html"|"text" OUTPUT "pdf"|"docx" SET ?path | Convert HTML/text/a URL into a finished document |
RICH OPEN/NEW/READ/SAVE/PAGE/HEADER/FOOTER/INSERT/FORMAT/MOVE/RESIZE/DELETE/EXPORT | Build a rich text document from scratch — see Documents & Rich Text |
RICH OPEN "path.rtf"|"path.pdf"|"path.docx"|"path.html" SET ?doc | Reopen any format RICH EXPORT can write |
RICH PAGE ?doc SIZE ORIENTATION "portrait"|"landscape" MARGIN TOP n BOTTOM n LEFT n RIGHT n | Page setup — size, orientation, margins |
RICH INSERT ... ITALIC true|false UNDERLINE true|false STRIKETHROUGH true|false | Text style booleans on a paragraph/heading |
RICH MOVE/RESIZE/DELETE ?doc ELEMENT ?el("id") | ELEMENT is the modifier keyword identifying which inserted item to target by id |
NEW PRESENTATION INTO "path" SET ?file AS OPEN SLIDE...CLOSE | Build a PPTX presentation |
PRESENTATION OPEN "path" SET ?file | Open an existing deck for editing |
PRESENTATION ?file SAVE / SAVE INTO "path" | Write the deck back, or write a copy |
PRESENTATION ?file ADD SLIDE LAYOUT "type" [AT n] OPEN...CLOSE | Insert a slide at a position, or append when AT is omitted |
PRESENTATION ?file SLIDE n REPLACE ... / MOVE TO n / DELETE | Rewrite, reorder, or remove a slide |
SLIDE LAYOUT "type" DURATION "3s" TRANSITION "type" DURATION "..s" | Slide layout, auto-advance, and transition |
TITLE/SUBTITLE/BODY/IMAGE/VIDEO/GRAPH/TABLE/BULLET/NOTE/BACKGROUND/THEME/FONT/COLOR | Slide content verbs, positioned with AT/FORMAT/ALIGN |
BULLET OPEN ITEM "text" ... CLOSE | ITEM is the child verb — one bullet point per ITEM inside a BULLET block |
ALIGN LEFT|CENTER|CENTRE|RIGHT TOP|MIDDLE|BOTTOM | Full alignment value set — horizontal then vertical |
ANIMATE ENTER/EXIT/EMPHASIS "type" DELAY "..s" DURATION "..s" | Per-element animation |
PRESENTATION ?file SLIDE COUNT/EXPORT AS "png" / EXPORT AS "gif"|"mp4" | Frame control and animated export |
WEATHER "city" SET ?w | Current weather |
CURRENCY RATE FROM "a" TO "b" SET ?rate / CURRENCY CONVERT n FROM "a" TO "b" SET ?amount | Exchange rates and conversion |
GEOIP ADDRESS/CITY/COUNTRY/ALL SET ?geo | Geolocate the current request or a given IP |
DNS "domain" AS "A"|"MX"|"TXT" SET ?r | DNS record lookup |
dns1.ocalt.com / dns2.ocalt.com | Ocalt’s nameservers — delegate a domain to them when you have no DNS provider of your own |
NOTIFY CHECK PUSH STATUS FOR ?uid / REQUEST PUSH GRANT FOR ?uid WITH "url" | Web push subscription status and consent flow |
PUSH SUBSCRIBE ?sub AS ?uid / PUSH UNSUBSCRIBE ?uid | Manual push subscription management |
NOTIFICATION "text" | Notify the namespace owner — for watch, cron and schedule outcomes |
NOTIFY "body" TO ?uid WITH "title" ICON IMAGE LINK ACTIONS SET ?id | Send a push notification |
NOTIFY LIST FOR ?uid / MARK READ / CLEAR / CLEAR ALL | Notification history management |
WEBHOOK SEND ?payload TO "url" SECRET "key" SET ?response | Signed outbound webhook |
NEW WEBHOOK RECEIVE SECRET "key" TRIGGER [RUN op] SET ?webhook | Signed inbound webhook endpoint |
WEBHOOK LIST / WEBHOOK DELETE | Webhook registry |
SCHEDULE [RUN op] AT ?datetime SET ?job | Run an expression once, at a future moment |
NEW CRON [RUN op] EVERY n UNIT STARTING NOW|?datetime SET ?job | Run an expression repeatedly, on an interval |
SCHEDULE/CRON LIST / DESCRIBE / DELETE | Job registry |
NEW WATCH TABLE "t" FROM "db" ON "insert"|"update"|"delete" TRIGGER [RUN op] SET ?watch | React to database changes |
NEW WATCH FILE "path" ON "created"|"modified"|"deleted" TRIGGER [RUN op] | React to filesystem changes |
NEW WATCH PERSISTENT ?var ON "changed" TRIGGER [RUN op] | React to a PERSISTENT value changing |
NEW WATCH [FETCH "url"] EVERY n UNIT ONCHANGE [RUN op] | React to an external resource changing |
WATCH LIST / DESCRIBE / DELETE | Watch registry |
NEW TRANSCODE STREAM FROM "rtsp://"|"file" FORMAT "hls"|"mse" SET ?stream | Live/continuous media streaming |
TRANSCODE STREAM ?stream STOP | Stop a stream |
EDITOR OPEN "path" SET ?doc | Open a file for text/code editing |
NEW EDITOR [AS "lang"] SET ?doc | Start a document with no file behind it — first write is SAVE INTO |
EDITOR ?doc GOTO/SELECT/SELECTION/PASTE/INSERT/DELETE/BACKSPACE/REPLACE/EXTRACT/FIND/DUPLICATE/MOVE/JOIN/INDENT/SORT LINES/DEDUPLICATE LINES/TRIM/CONVERT/BOOKMARK/COUNT/SAVE/LANG | Full text editor verb set |
EDITOR ?doc SELECT BLOCK FROM LINE n COL n TO LINE n COL n | Rectangular/column block selection, distinct from linear FROM..TO |
EDITOR ?doc OUTDENT LINE n / SELECTION ?sel OUTDENT | Remove one indent level |
EDITOR ?doc BOOKMARK LINE n / BOOKMARK REMOVE LINE n / BOOKMARKS SET ?lines | Set, remove, and list line bookmarks |
EDITOR ?doc TRIM TRAILING WHITESPACE | Remove trailing whitespace from every line |
EDITOR ?doc CONVERT LINE ENDINGS TO "LF"|"CRLF" | Normalize line ending style |
EDITOR ?doc CONVERT TABS TO SPACES / SPACES TO TABS | Indentation character conversion |
EDITOR ?doc CONVERT ENCODING TO "UTF-8" | Change file text encoding |
OcaltQL Advanced
| Verb | Description |
|---|---|
NEW CLASS Name WITH "prop" AS TYPE REQUIRED|DEFAULT val AND "method" AS METHOD OPEN...CLOSE | Define a class |
SPAWN Name WITH "prop" AS val AND ... SET ?instance | Instantiate a class |
CALL "method" ON ?instance | Invoke an instance method — THIS bound inside |
EXTENDS ParentClass | Class inheritance, child overrides same-named members |
NEW QUERY "word" CASE "sensitive" SEPARATOR "." OPEN...CLOSE | Register a custom natural-language phrase-tree command |
SKIPPABLE | Marks a phrase-tree node as optional to invoke |
QUERY prefix ... | Invoke a phrase colliding with a reserved OQL verb |
ACCOUNT REGISTER/LOGIN/SESSION/LOGOUT/REFRESH/REVOKE/VERIFY/COMPARE/DELETE/UPDATE EMAIL|PASSWORD | Full end-user accounts system, see Accounts System |
CHAT WITH "n" PEERS "a" AND "b"... SET ?room | Create a chat room |
CHAT ENTRY FROM "user" MESSAGE `text` TO ?room SET ?msg | Send a chat message |
DIRECTIVE "id" EXEC "cmd" [BACKGROUND] SET ?r / KILL ?pid | Remote shell execution |
DIRECTIVE "id" DOWNLOAD/UPLOAD "path" TO "path" SET ?h / STATUS ?h | Remote file transfer with progress |
DIRECTIVE "id" SCREENSHOT / WAKE | Remote screen capture / Wake-on-LAN |
DIRECTIVE "id" SERVE "path" SET ?src | Serve one file straight off the machine — returns a public url at serve.ocalt.com/<token>.<ext> plus the local port |
DIRECTIVE "id" TUNNEL PORT n SET ?tunnel / TUNNEL END ?tunnel | Expose a local port publicly with no port forwarding |
DIRECTIVE PEERS "id" AND "id" SET ?network | Group machines into a peer network |
DIRECTIVE NETWORK ?network TRANSFER FROM "id://path" TO "id://path" SET ?anchor | Direct machine-to-machine file transfer, non-blocking |
DIRECTIVE STATUS ?anchor SET ?progress | Peer transfer progress |
DIRECTIVE "id" POLL n SECONDS|MINUTES | Agent check-in interval, 1 SECOND to 60 MINUTES |
DIRECTIVE NETWORK ?n SHARE "id" PORT n AS n SET ?status | Expose a peer's port on every other peer's localhost |
DIRECTIVE "id" LIST FROM "path" / LIST DRIVES | Browse the machine's folders and drives |
DIRECTIVE LIST / STATUS "id" | Agent registry |
SUBDOMAIN ADD "name" [ON "tld.com"] [AT "path"] SET ?result | Register a subdomain — ON puts it on a pointed domain, AT chooses the folder, default /root/sites/{subdomain} |
SUBDOMAIN REMOVE/LIST/SEARCH "name" SET ?result | ocalt.site subdomain management |
DOMAIN "tld.com" TO "subdomain.ocalt.site" SET ?var | Point a domain you own at a subdomain or tunnel — ?var("status"), ?var("message") |
DOMAIN STATUS "tld.com" SET ?status | Current pointing state and reason |
DOMAIN SSL "tld.com" SET ?ssl | Issue and track the certificate — already in progress | failed try again | successful - certificate is live |
SET PERSISTENT ?var AS val / typed-verb form / EMIT PERSISTENT ?var | Cross-request value with no expiry, scoped to the session — PERSISTENT is written on every use |
START PERSIST / KILL PERSIST | Standing execution timeline, no time limit, until explicitly killed |
SET CONSISTENT "key" AS val / CONSISTENT "key" SET ?var / [CONSISTENT "key"] | Sessionless value shared across the whole namespace — never across namespaces |
NEW VIDEO|AUDIO BRIDGE n PEERS SET ?room | WebRTC signaling room — connect_url per peer, no bundled UI |
BRIDGE CLOSE ?room("id") | Close a bridge room |
NEW TRANSCODE STREAM ... (see Services) | Live streaming shares the same relay as SYNC CHANNEL/Bridge |
BROWSER OPEN "url" SET ?session | Start a headless browser automation session |
BROWSER ?s NAVIGATE/CLICK/TYPE/SELECT/HOVER/UPLOAD/CLEAR/SCROLL/BACK/FORWARD/RELOAD/CLOSE | Page interaction |
BROWSER ?s READ/EXTRACT/EVALUATE | Content extraction and raw JS execution |
BROWSER ?s WAIT n / WAIT FOR selector/text/NETWORK | Explicit and conditional waits |
BROWSER ?s TAB NEXT|PREV / FOCUS CHECK | Keyboard tab-order interaction |
BROWSER ?s STORAGE READ|WRITE / COOKIES / COOKIE WRITE / AUTH | Storage, cookies, HTTP auth |
BROWSER ?s VIEWPORT / MOBILE "device" | Viewport size and device emulation |
BROWSER ?s SCREENSHOT / PDF / DOWNLOAD / NETWORK LOG / INTERCEPT / STREAM TO | Capture, network inspection, live frame streaming |
SSH "user" AT "host" PASSWORD|KEY "..." [ON "port"] ENTER `cmd` SET ?result | Remote SSH command execution |
SSH ... UPLOAD/DOWNLOAD "path" TO/INTO "path" | SSH file transfer |
WEBASSEMBLY GRANT ?var AS "alias" | Expose an OQL variable to an embedded runtime |
WEBASSEMBLY TYPE "php"|"wasm" ENTER `code`|"module.wasm" SET ?result | Execute embedded PHP or a WASM module |
NEW EVENT "title" ON "date" FROM/TO TIMEZONE WITH DESCRIPTION/ATTENDEES AT LOCATION REMIND SET ?ev | Create a calendar event |
NEW EVENT ... ALL DAY / EVERY weekday ... STARTING ... UNTIL ... | All-day and recurring events — EVERY accepts any weekday name (MONDAY, TUESDAY, etc.) |
NEW EVENT ... REMIND n MINUTES BEFORE [THEN action] | Reminder timing, optionally firing a follow-up action |
... THEN action | Attach an action to fire alongside a reminder |
GET EVENTS TODAY|THIS WEEK|THIS MONTH|FROM..TO / GET NEXT EVENT / GET EVENT ?id | Query events |
GET EVENTS ... WHERE ... | Filter event queries |
UPDATE ?ev SET TITLE TO / MOVE TO / ADD ATTENDEE / REMOVE ATTENDEE | Modify an event |
REMOVE EVENT ?ev [AND ALL OCCURRENCES] | Delete an event or its whole series |
NEW CALENDAR "name" WITH DESCRIPTION COLOR SET ?cal / LIST CALENDARS / DROP CALENDAR | Calendar management |
CHECK AVAILABILITY FROM..TO FOR n MINUTES SET ?slots / BOOK SLOT | Scheduling/booking |
EXPORT/IMPORT CALENDAR TO/FROM FILE "path.ics" | iCal import/export |
APPLICATE TYPE "platform/format" FROM "folder" TO "path" SIGN WITH IDENTIFIER TITLE SET ?file | Package OQL/HTML/JS/assets into native apps — Android, Windows, macOS, iOS, Linux |
APPLICATE TYPE "web/pwa" AT "path" | In-place PWA injection into an already-live Site Mode folder |
ocalt.manifest.json | External app metadata file read by APPLICATE |
Conditions, Loops & Operators
| Verb | Description |
|---|---|
IF condition OPEN...CLOSE OR OPEN...CLOSE | If/else — OR branch runs when condition is false |
OR IF condition OPEN...CLOSE | Chained else-if |
IS EQUAL TO / IS NOT EQUAL TO | Loose value equality |
IS IDENTICAL TO / IS NOT IDENTICAL TO | Strict/type-sensitive equality |
IS GREATER THAN / IS LESS THAN | Numeric comparison |
IS GREATER THAN OR EQUAL TO / IS LESS THAN OR EQUAL TO | Inclusive numeric comparison |
CONTAINS "substr" | Substring/containment check |
IS SET / IS NOT SET | Variable existence |
IS EMPTY / IS NOT EMPTY | Empty string/array/object check |
IS NULL / IS NOT NULL | Null check |
... AND ... / ... OR ... (inside a condition) | Combine multiple conditions in one IF |
?arr ARE EQUAL TO x | True only if every element matches |
SOME ?arr ARE EQUAL TO x | True if at least one element matches |
SOME ?arr ARE GREATER/LESS THAN x | At-least-one numeric match across an array/object |
!THIS('some') | Inside a SOME/ARE block — the matching indices/keys |
WHILE condition OPEN...CLOSE | Loop while a condition holds |
WHILE SOME ?arr ARE ... | Loop while at least one element matches |
LOOP a TO b SET ?i OPEN...CLOSE | Counted loop, ascending |
LOOP a TO b STEP n SET ?i | Counted loop with a custom step |
LOOP b TO a STEP -n SET ?i | Descending counted loop |
LOOP INFINITE OPEN...CLOSE | Infinite loop — deliberately never terminates |
BREAK | Exit the current LOOP/WHILE early |
CONTINUE | Skip to the next LOOP/WHILE iteration |
SWITCH ?var OPEN CASE "v" ... BREAK ... DEFAULT ... CLOSE | Multi-branch dispatch |
CASE "a" CASE "b" (no BREAK between) | Fallthrough — multiple case values share one body |
Execution States
| Verb | Description |
|---|---|
?var IS true / IS false | Explicit boolean state |
?var IS NULL | Never declared, or explicitly returned as null |
?var IS EMPTY | Declared but holds an empty string/array/object |
?var IS WAITING | A PROMISE that has not yet resolved |
?var IS INFINITE | A PROMISE whose connection broke — will never resolve |
LOOP INFINITE | Deliberate infinite-loop execution state |
Math & CALCULATE
| Verb | Description |
|---|---|
CALCULATE expr SET ?result | Evaluate a math expression — +, -, *, /, parentheses, standard precedence |
CALCULATE ABS(n) / ROUND(n) / FLOOR(n) / CEIL(n) | Built-in CALCULATE functions |
CALCULATE POWER(a,b) / SQRT(n) / MOD(a,b) | More CALCULATE functions |
COMPUTE fibonacci|factorial|prime|sqrt|abs|round|floor|ceil OF n SET ?r | Named single-argument computations |
COMPUTE power|mod OF a AND b SET ?r | Named two-argument computations |
ADD a TO b SET ?ans | Natural-language addition |
SUBTRACT a FROM b SET ?ans | Natural-language subtraction |
MULTIPLY a BY|WITH b SET ?ans | Natural-language multiplication — BY/WITH interchangeable |
DIVIDE a BY b SET ?ans | Natural-language division |
SQUARE ROOT OF n SET ?ans | Natural-language square root |
LOGARITHM OF n [BASE b] SET ?ans | Natural log by default, or a specified base |
FIBONACCI OF n / FACTORIAL OF n / PRIME OF n SET ?ans | Natural-language named computations |
ABSOLUTE VALUE OF n / ROUND OF n / FLOOR OF n / CEILING OF n SET ?ans | Natural-language rounding functions |
RAISE a TO b SET ?ans | Natural-language exponentiation |
MODULO a BY b SET ?ans | Natural-language modulo |
[expr] nested inline | Bracket syntax nests any expression inline as a value, e.g. inside another CALCULATE/MULTIPLY |
!THAT | Auto-updating result of the last statement — chains naturally through ADD/MULTIPLY/etc. |
Strings
| Verb | Description |
|---|---|
STRING "text" SET ?var | Declare a string, supports & concatenation inline |
LENGTH ?str SET ?n | String length |
STRING UPPERCASE ?str / STRING LOWERCASE ?str SET ?out | Case conversion |
TRIM STRING ?str SET ?out | Trim whitespace |
REVERSE STRING ?str SET ?out | Reverse a string |
REPLACE STRING ALL "a" WITH "b" WHERE "text" SET ?out | Replace every occurrence |
REPLACE STRING ONCE "a" WITH "b" WHERE "text" | Replace the first occurrence only |
REPLACE STRING FROM n TO n WITH "b" WHERE "text" | Replace by position range |
SEARCH STRING ?str FOR "substr" SET ?pos | Find substring position, or null |
SELECT STRING "text" FROM n TO n SET ?sub | Substring by position range |
SPLIT "text" BY "," SET ?parts | Split into an array by separator (empty separator splits into characters) |
Arrays, Objects & Multiarrays
| Verb | Description |
|---|---|
NEW ARRAY SET ?arr / APPEND val TO ?arr | Create an array and append values |
?arr(n) | Index access |
COUNT ?arr SET ?n | Element count |
REMOVE KEY n FROM ?arr SET ?arr | Remove by index, array repacks automatically |
REVERSE ARRAY ?arr SET ?rev | Reverse order |
SEARCH ARRAY ?arr FOR val SET ?found | Find index of a value, or null |
JOIN ?arr [WITH "sep"] SET ?str | Join into a string, separator optional. JOIN ARRAY is an accepted alias |
SLICE ?arr FROM n TO n SET ?sub | Subset by index range |
SORT ?arr SET ?sorted | Sort ascending |
MERGE ARRAY ?a WITH ?b SET ?combined | Concatenate two arrays |
DEDUPLICATE ?arr SET ?unique | Remove duplicate values |
NEW OBJECT SET ?obj / SET ?obj("key") AS val | Create an object and set keys |
?obj("key") / "key" OF ?obj | Two equivalent access notations |
COUNT ?obj SET ?n | Property count |
REMOVE KEY "k" FROM ?obj SET ?obj | Remove a property entirely — not null, gone |
KEYS ?obj SET ?arr / VALUES ?obj SET ?arr | List all keys / all values |
APPEND "key" AS val TO ?obj | Add a property via APPEND form |
SEARCH OBJECT ?obj FOR val SET ?key | Find the key holding a value, or null |
MERGE OBJECT ?a WITH ?b SET ?combined | Merge two objects — right side wins on key collision |
NEW OBJECT ["k" AS v AND "k2" AS v2] SET ?obj | Inline object literal |
[item1 AND item2 AND item3] | Inline array literal |
FOREACH ?arr SET ?value OPEN...CLOSE | Iterate an array's values |
FOREACH ?arr SET ?key AS ?value | Iterate with index/key and value |
FOREACH ?obj SET ?key AS ?value | Iterate an object's properties |
NEW MULTIARRAY SET ?m / APPEND ?row TO ?m | Array-of-arrays for grid/nested data |
?m(row)(col) / col OF row OF ?m | Two equivalent nested-access notations |
FLATTEN ?m SET ?flat | Collapse a multiarray into one flat array |
Date & Time
| Verb | Description |
|---|---|
NEW DATE / NEW TIME / NEW DATE AND TIME SET ?var | Current date/time/both |
NEW DATE FROM "..." / NEW TIME FROM "..." / NEW DATE AND TIME FROM "..." | Parse from a specific string |
CALCULATE ?date +/- n DAY|WEEK|MONTH|YEAR | Date arithmetic |
CALCULATE ?dt +/- n MINUTES|HOURS | Datetime arithmetic |
CALCULATE ?date FIRST DAY / LAST DAY | First/last day of the month |
GET ?date DAY FULLNAME|SHORTNAME / MONTH FULLNAME|SHORTNAME | Named day/month components |
GET ?dt YEAR|MONTH|DAY|HOUR|MINUTE|SECOND | Numeric components |
GET ?dt TIMESTAMP SET ?unix | Unix timestamp |
FORMAT DATE|TIME|DATE AND TIME ?var AS "pattern" SET ?str | Custom format string |
CALCULATE ?a - ?b AS days|hours|years SET ?diff | Difference between two dates, in a chosen unit |
CONVERT TIMEZONE ?dt TO "tz" SET ?converted | Timezone conversion |
RANDOMIZE DATE|TIME|DATE AND TIME FROM RANGE "a" TO "b" SET ?r | Random date/time within a range |
Convert & Cast
| Verb | Description |
|---|---|
CONVERT IMAGE "path" TO FORMAT [AS "path"|SET ?path] | Convert image format |
CONVERT DOCUMENT "path" TO FORMAT AS "path" | Convert document format |
CONVERT VIDEO "path" TO FORMAT AS "path" | Convert video format |
CONVERT AUDIO "path" TO FORMAT AS "path" | Convert audio format |
... SET PROMISE ?job | Any CONVERT can run in the background — WAIT FOR to collect |
CAST ?var AS STRING|NUMBER|BOOL|DATE|JSON|OQLOBJECT | Type conversion between OQL values |
CAST ?date FROM "pattern" | Custom input format when casting to DATE |
ENCODE ?str AS BASE64|URL|HEX SET ?out | Encode a string |
DECODE ?str AS BASE64|URL|HEX SET ?out | Decode a string |
FORMAT NUMBER ?n WITH n DECIMALS SET ?str | Fixed decimal places |
FORMAT NUMBER ?n AS INTEGER|SCIENTIFIC|CURRENCY SET ?str | Other number formats |
PARSE ?str AS JSON|OQLOBJECT|CSV|XML|YAML|TOML|QUERY STRING|HTML|MARKDOWN SET ?out | Parse a string in a given format into a usable OQL value |
Crypto & Compute
| Verb | Description |
|---|---|
GENERATE HASH FOR ?str AS sha256|md5|sha1|blake2 SET ?hash | One-way hash |
ENCRYPT ?str USING ?key AS aes|chacha20|des SET ?out | Symmetric encryption |
DECRYPT ?str USING ?key AS aes|chacha20|des SET ?out | Symmetric decryption |
GENERATE KEY AS aes|chacha20|rsa|ecc SET ?key | Generate a cryptographic key |
GENERATE UUID SET ?id | Generate a UUID |
RANDOMIZE FROM RANGE a TO b AS integer|decimal [PLACES n] SET ?r | Random number in a range |
RANDOMIZE STRING LENGTH n AS alphanumeric|hex|numeric|uppercase|lowercase SET ?r | Random string of a given charset |
RANDOMIZE FROM STRING "charset" [LENGTH n] SET ?r | Random string from a custom charset |
HTTP, Network & Sockets
| Verb | Description |
|---|---|
FETCH "url" SET ?data | Basic GET request |
FETCH "url" SET PROMISE ?data | Non-blocking fetch — collect later with WAIT FOR |
... METHOD "post" BODY "..." HEADER "..." TIMEOUT n SECONDS | FETCH modifiers |
... IP "x.x.x.x" / IP ALIAS "..." | Force a specific outbound IP |
... PROXY "http://..."|"socks5://..." | Route through a proxy |
... USER AGENT "..." | Custom user agent string |
... INTO "path" | Save the response directly to a file |
... SET ?code WITH STATUS AND SET ?body WITH DATA | Capture status code and body separately |
CURL ... | Direct alias for FETCH, identical modifiers |
STATUS n | Set the HTTP response status code — does not stop execution |
WEBSOCKET "wss://..." SET ?ws / SEND ?ws "msg" / RECEIVE ?ws SET ?msg / CLOSE ?ws | Raw WebSocket client |
TCP "host" PORT n SET ?tcp / SEND / RECEIVE | Raw TCP client |
UDP "host" PORT n SEND "msg" | Raw UDP send |
Image Processing
| Verb | Description |
|---|---|
NEW RAW IMAGE WIDTH w HEIGHT h SET ?img AS OPEN PIXEL X n Y n AS "r,g,b[,a]" CLOSE | Build an image pixel-by-pixel from scratch |
IMAGE LOAD "path or url" SET ?img | Load an existing image |
GRAPHIC ?img EXPORT AS "png"|"jpg"|"bmp"|"webp"|"gif" SET ?bytes | Export to a format |
GRAPHIC ?img RESIZE WIDTH w [HEIGHT h] SET ?img | Resize, aspect-preserved if height omitted |
GRAPHIC ?img CROP POSITION X n Y n WIDTH w HEIGHT h | Crop |
GRAPHIC ?img ROTATE n / FLIP HORIZONTAL|VERTICAL | Rotate/flip |
GRAPHIC ?img THUMBNAIL WIDTH w HEIGHT h | Generate a thumbnail |
GRAPHIC ?img FILTER AS GREYSCALE|SEPIA|BLUR|SHARPEN|INVERT | Apply a filter, optionally scoped to a selection |
GRAPHIC ?img SELECT RECTANGLE|ELLIPSE|LASSO|COLOR ... SET ?sel | Make a selection |
GRAPHIC ?img REPLACE "color" WITH "color" | Replace a color throughout the image |
GRAPHIC ?img FILL X n Y n WITH "color" | Flood fill |
GRAPHIC ?img GET COLOR OF X n Y n SET ?color | Sample a pixel's color |
GRAPHIC ?img TEXT "..." POSITION FONT SIZE COLOR WEIGHT OUTLINE SHADOW BACKGROUND | Draw text onto an image |
GRAPHIC ?img WATERMARK WITH "text"|?logo_img | Apply a watermark |
GRAPHIC ?img COMPOSITE WITH ?overlay AT X n Y n | Composite one image onto another |
GRAPHIC ?img REMOVE BACKGROUND | Background removal |
GRAPHIC ?img HISTOGRAM SET ?data | RGB histogram data |
NEW GRAPHIC LAYER SET ?layer / GRAPHIC ?img ADD LAYER ?layer | Layer system |
GRAPHIC ?layer ORDER ABOVE|BELOW / OPACITY n / BLEND "mode" / HIDE / SHOW | Layer stacking and blending |
GRAPHIC ?img FLATTEN SET ?final | Merge all layers into one image |
GRAPHIC ?img CUT|COPY|DELETE|MOVE|PASTE ?sel ... | Selection-based editing operations |
Media (Video & Audio) Processing
| Verb | Description |
|---|---|
MEDIA LOAD "path" SET ?media | Load a video/audio file |
MEDIA ?media PROBE [VIDEO|AUDIO] SET ?info | Inspect codec/format/duration metadata |
MEDIA ?media EXPORT AS "format" SET ?out | Export to mp4/webm/avi/mkv/mov/gif/mp3/wav/ogg/flac/aac |
MEDIA ?media TRANSCODE AS "format" SET ?out | Transcode to another container/codec |
MEDIA ?media SCALE WIDTH w [HEIGHT h] SET ?out | Resize video, aspect-preserved if height omitted |
MEDIA ?media SPEED n SET ?out | Playback speed, audio pitch auto-corrected |
MEDIA ?media TRIM FROM "hh:mm:ss" TO "hh:mm:ss" SET ?clip | Cut a clip |
MEDIA ?a SPLICE WITH ?b SET ?joined | Concatenate clips |
MEDIA ?media EXTRACT FRAME AT "time" SET ?frame | Grab a single still frame |
MEDIA ?media INSERT FRAME ?img AT "time" DURATION n SET ?out | Insert a still image as a frame |
MEDIA ?media INSERT CLIP ?clip AT "time" DURATION n [LOOP] | Insert another clip |
MEDIA ?media REPLACE FRAME WITH ?img FROM..TO | Replace a frame range with an image |
MEDIA ?media REPLACE CLIP WITH ?clip FROM..TO | Replace a clip range |
MEDIA ?media EXTRACT AUDIO SET ?audio / REPLACE AUDIO WITH ?a / MUTE | Audio track manipulation |
MEDIA ?audio NORMALIZE / VOLUME n / PITCH n | Audio level and pitch |
MEDIA ?a MIX WITH ?b SET ?mixed | Mix two audio tracks |
MEDIA ?media FADE IN|OUT DURATION n FROM n | Audio/video fade |
MEDIA ?media OVERLAY ?img AT X n Y n / SUBTITLE WITH "file.srt" | Overlay an image / burn in subtitles |
MEDIA ?media TEXT "..." POSITION SIZE COLOR FONT | Draw text onto video |
MEDIA ?media BLUR RADIUS n / COLOR GRADE CONTRAST SATURATION BRIGHTNESS GAMMA | Visual effects and color grading |
MEDIA ?media MIRROR HORIZONTAL|VERTICAL / REVERSE / STABILIZE | Flip, reverse playback, stabilize shake |
MEDIA ?media FREEZE FRAME AT "time" DURATION n / BOOMERANG / LOOP TIMES n | Freeze-frame, boomerang, repeat |
MEDIA ?media GREEN SCREEN WITH ?bg KEY "0xHEX" SIMILARITY n BLEND n | Chroma key compositing |
MEDIA ?a SPLIT SCREEN WITH ?b HORIZONTAL|VERTICAL | Side-by-side/stacked composite |
MEDIA ?a TRANSITION WITH ?b DURATION n SET ?final | Cross-fade transition between two clips |
NEW TIMELINE SET ?t / TIMELINE ?t ADD TRACK "video"|"audio" | Multi-track timeline editing |
TIMELINE ?t SAVE / SAVE INTO "path.oql" / TIMELINE OPEN "path.oql" | Persist a timeline as native OcaltQL source text and reopen it |
TIMELINE ?t TRACK n PLACE ?clip AT "time" / RENDER SET ?final | Place clips on tracks, render the final composite |
MEDIA ?media SPEED RAMP FROM..TO RATE n | Variable speed ramping over a time range |
MEDIA ?media AUTO CAPTION [LANGUAGE STYLE COLOR POSITION] | Automatic caption generation |
Mail & Mailbox Management
| Verb | Description |
|---|---|
MAIL TEXT|HTML BODY "..." TO "..." SUBJECT "..." | Send an email |
... CC "..." / BCC "..." | Carbon copy / blind carbon copy |
... HEADER "Name: value" | Custom email header |
... REPLY TO "..." | Set reply-to address |
... ATTACH "path" | Attach a file |
REDIRECT "url" [AS "302"] | HTTP redirect, ends the script |
NEW EMAIL ACCOUNT "name" AT "subdomain.ocalt.site"|"domain.com" WITH PASSWORD "pw" SET ?acc | Create a mailbox on a subdomain you own or a domain pointed at Ocalt — returns address, imap_host, pop3_host |
NEW EMAIL IMAP "host" WITH "password" AS "user" SET ?conn | Connect to an IMAP mailbox |
EMAIL ?conn LIST FOLDERS / INBOX / SENT / DRAFTS / SPAM / TRASH / FOLDER "name" | Mailbox folder access |
EMAIL ?conn UNREAD / SEARCH "query" | Filter messages |
EMAIL ?conn UID uid SET ?msg | Fetch a specific message by UID |
EMAIL ?conn MARK uid AS READ|UNREAD|FLAGGED|UNFLAGGED|DELETED | Change message flags |
EMAIL ?conn MOVE uid TO "folder" / COPY uid TO "folder" | Move/copy a message between folders |
EMAIL ?conn LABELS uid / ADD LABEL / REMOVE LABEL | Gmail-style label management |
EMAIL ?conn SAVE DRAFT TO ... SUBJECT ... BODY ... | Save a draft |
EMAIL ?conn SEND TO ... CC BCC SUBJECT BODY REPLY TO HEADER ATTACH | Send via an open IMAP connection |
EMAIL ?conn CLOSE | Close the connection |
NEW EMAIL POP3 "host" WITH "password" AS "user" SET ?conn | Connect to a POP3 mailbox |
EMAIL ?conn LIST SET ?messages | List messages (uid, size only — full fields need UID fetch) |
EMAIL ?conn DELETE uid | Delete a message |
Cache, Remember & Timing
| Verb | Description |
|---|---|
REMEMBER "key" AS val | Store a value in namespace-persistent key/value storage, no expiry |
RECALL "key" SET ?var | Read a remembered value, or null |
FORGET "key" | Delete a remembered value |
CACHE STORE "key" AS val TTL n SECONDS|MINUTES|HOUR | Store with an expiry |
CACHE GET "key" SET ?var | Read a cached value, null if expired/missing |
CACHE REMOVE "key" | Delete a cached value early |
SLEEP n MILLISECONDS|SECONDS|MINUTES|HOUR | Block execution for a fixed duration |
FETCH "url" SET PROMISE ?var | Start an async operation without blocking |
WAIT FOR ?promise [n SECONDS] SET ?result | Block until a promise resolves, optional timeout |
?promise IS SET|EMPTY|WAITING|INFINITE | Promise state checks |