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

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 ?varDeclare a string variable
NUMBER n SET ?varDeclare a number variable
SET ?var AS valueGeneric assignment form
SET ?var2 AS ?var1Copy a variable to another variable
VARIABLE ?var1 SET ?var2Copy a variable — alternate form
UNSET ?varDestroy a variable entirely
IF ?var IS SETCheck whether a variable currently exists
ANDChain — parallel branches, random resolution if multiple SET the same var
AFTERChain — sequential, waits for prior statement(s)
ORChain — fallback when the preceding statement fails/returns false/null
COLLAPSE ?multivar SET ?arrConvert a multivariable into an ordered array
CATCH ERROR SET ?errCapture the error from a failed statement without stopping the chain
WARNING stateA 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 ... CLOSEMulti-branch dispatch, BREAK per case, fallthrough if BREAK omitted
BREAKExit a LOOP/WHILE or SWITCH CASE early
CONTINUESkip to the next LOOP/WHILE iteration
EXITEnd the script immediately
EXIT nEnd the script, setting HTTP status n
NEW OPERATION name WITH ?params OPEN...CLOSEDefine a reusable operation
NEW PERSISTENT OPERATION name ... / RUN PERSISTENT nameRegister an operation across executions, and call it from a later script
RUN name WITH args SET ?resultExecute a defined operation
RETURN valueReturn 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 SESSIONOpen/destroy server-side session state
SET "key" AS value OF !SESSIONWrite a session value
EMIT !SESSION('key')Read a session value
COOKIE SET/GET/REMOVEClient-side cookie management, with PATH/EXPIRES/DOMAIN/SECURE/HTTPONLY
HEADER "name" AS "value"Set an HTTP response header
!POST / !GET / !REQUESTRead 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
!QUERYThe OcaltQL script currently being executed, as submitted
!THATAuto-updating global — result of the most recently completed statement

OcaltQL Web

Verb Description
NEW HTML SET ?html OPEN...CLOSEBuild 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...CLOSEBuild a detached node for later insertion
HTML APPEND ?node TO ?htmlAppend 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 ?oqlParse raw HTML/fetched markup into OQL's native node form
HTML GET ".selector" SET ?elSelect a single element (querySelector)
HTML GET ALL ".selector" SET ?elarraySelect 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 ?scriptGenerate 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 ?nodeGenerate 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 ?namesOne icon as pure SVG, or every name in an icon set
UX ?c ANIMATE ENTER|EXIT|EMPHASIS "type" DELAY DURATIONAttach 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 ?mDeclared states of one component, or every component generated this execution
NEW ONBROWSER AJAX TO "/path" NAMED "fn" ON SUCCESS `code` [ON ERROR `code`] SET ?scriptSame, targeting a different page on the same site — result holds the response body
GATHER STRING|NUMBER|DATE|EMAIL|REGEX LABEL "..." SET ?varHalt-and-resume popup collecting one input value
GATHER STRING LENGTH MIN n MAX nString length constraint
GATHER NUMBER VALUE MIN n MAX nNumber 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 ?boolHalt-and-resume yes/no popup
USER DEVICE LABEL "..." SET ?deviceRequest every permission and device property at once
USER DEVICE CAMERA|MICROPHONE|GEOLOCATION|PUSH|CLIPBOARD_READ|CLIPBOARD_WRITERequest a single named permission
USER DEVICE SCREENSHOTReal screen/window/tab capture via native browser picker — returns captured content, not just a status
USER DEVICE PERMISSIONLESSSilently collect only free device properties, no popup
USER DEVICE PERMISSIONSRequest all six status-based permissions together, no screenshot
NEW SYNC CHANNEL SET ?channelOpen a real-time WebSocket relay channel
SYNC CHANNEL ?channel SEND ?payloadPush data to the browser with no incoming request
SYNC CHANNEL ?channel RECEIVE SET ?dataNon-blocking read of the next queued message, or null
SYNC CHANNEL ?channel CLOSEClose 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 ?contentRead a file
FILE EXISTS "path" SET ?boolCheck existence
FILE STAT "path" SET ?infoFile metadata
FILE LIST "path" SET ?itemsDirectory 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 ?infoNamespace storage usage
FTP CONNECT "host" [ON "port"] AS "user" WITH "password"|KEY "path" [SECURE] SET ?connConnect to an FTP, FTPS or SFTP server
FTP ?conn LIST/STAT/UPLOAD/DOWNLOAD/MKDIR/MOVE/DELETE/CLOSEOperate on the remote server — see FTP & External Storage
FTP ?src TRANSFER "path" TO ?dst "path" SET ?anchor / FTP STATUS ?anchorServer-to-server transfer, non-blocking
EXTERNAL BIND FTP ?conn SET ?statusBind a server as /external — a namespace location alongside /root and /mounted
FILE SELECT "a" AND "b" SET ?selarraySelect multiple paths for batch operations
FILE SELECT ALL "folder" SET ?selarraySelect 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 ?urlGenerate a public share URL
FILE SHARE LIST SET ?arr / FILE UNSHARE "path"/ALLManage 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 ?idInsert a row
SELECT ROWS FROM DB "db" TABLE "t" WHERE ... ORDER BY ... LIMIT n SET ?rowsQuery rows
WHERE "col" IS GREATER/LESS THAN, IS EQUAL/IDENTICAL TO, IS PREFIX SIMILAR TO, IS NOT EMPTYWHERE 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 ?nCount matching rows
GROUP BY "col" FROM DB "db" TABLE "t" SET ?groupedGroup rows by column value
JOIN SELECT DB "db" TABLES "a" AND "b" WHERE ... SET ?resultsInner join
JOIN LEFT SELECT DB "db" TABLES "a" AND "b" WHERE ... SET ?resultsLeft join

OcaltQL Services

Verb Description
OCR "url or path" AS "lang" SET ?textExtract text from an image/PDF via OCR
MAP GEOCODE "address" LIMIT n COUNTRY "cc" BOUNDS ?box SET ?locAddress to coordinates
MAP REVERSE "lat,lon" DETAIL "level" SET ?addrCoordinates to address
MAP BOUNDARY "place" SET ?shapeAdministrative region polygon
MAP SEARCH "query" BOUNDS ?box SET ?placesPoints-of-interest search
MAP POINT LAT n LON n LABEL "..." ICON "..." POPUP "..." SET ?pointBuild 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 ?urlCompose and render a full map
MAP ROUTE "from" TO "to" VIA "waypoint" PROFILE "mode" ALTERNATIVES SET ?routeDriving/cycling/walking directions
MAP MATRIX ?points SET ?tableMany-to-many distance/duration matrix
MAP SNAP LAT n LON n SET ?snappedSnap a point to the nearest road
MAP DISTANCE "a" TO "b" SET ?kmStraight-line (Haversine) distance
MAP CLUSTER ?places SET ?clusters / MAP BOUNDS ?places SET ?boundsCluster points / bounding box
GRAPH TYPE "type" WITH ?data TITLE FORMAT THEME AXIS SET ?svgNative SVG chart — 40+ types, see Graphs - SVG Charts for the full catalog
GRAPH OPEN "chart.svg" SET ?svgRead 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 nSelect all pixels within n of a sampled color
DOC CREATE FROM STRING/URL AS "html"|"text" OUTPUT "pdf"|"docx" SET ?pathConvert HTML/text/a URL into a finished document
RICH OPEN/NEW/READ/SAVE/PAGE/HEADER/FOOTER/INSERT/FORMAT/MOVE/RESIZE/DELETE/EXPORTBuild a rich text document from scratch — see Documents & Rich Text
RICH OPEN "path.rtf"|"path.pdf"|"path.docx"|"path.html" SET ?docReopen any format RICH EXPORT can write
RICH PAGE ?doc SIZE ORIENTATION "portrait"|"landscape" MARGIN TOP n BOTTOM n LEFT n RIGHT nPage setup — size, orientation, margins
RICH INSERT ... ITALIC true|false UNDERLINE true|false STRIKETHROUGH true|falseText 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...CLOSEBuild a PPTX presentation
PRESENTATION OPEN "path" SET ?fileOpen 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...CLOSEInsert a slide at a position, or append when AT is omitted
PRESENTATION ?file SLIDE n REPLACE ... / MOVE TO n / DELETERewrite, 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/COLORSlide content verbs, positioned with AT/FORMAT/ALIGN
BULLET OPEN ITEM "text" ... CLOSEITEM is the child verb — one bullet point per ITEM inside a BULLET block
ALIGN LEFT|CENTER|CENTRE|RIGHT TOP|MIDDLE|BOTTOMFull 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 ?wCurrent weather
CURRENCY RATE FROM "a" TO "b" SET ?rate / CURRENCY CONVERT n FROM "a" TO "b" SET ?amountExchange rates and conversion
GEOIP ADDRESS/CITY/COUNTRY/ALL SET ?geoGeolocate the current request or a given IP
DNS "domain" AS "A"|"MX"|"TXT" SET ?rDNS record lookup
dns1.ocalt.com / dns2.ocalt.comOcalt’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 ?uidManual 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 ?idSend a push notification
NOTIFY LIST FOR ?uid / MARK READ / CLEAR / CLEAR ALLNotification history management
WEBHOOK SEND ?payload TO "url" SECRET "key" SET ?responseSigned outbound webhook
NEW WEBHOOK RECEIVE SECRET "key" TRIGGER [RUN op] SET ?webhookSigned inbound webhook endpoint
WEBHOOK LIST / WEBHOOK DELETEWebhook registry
SCHEDULE [RUN op] AT ?datetime SET ?jobRun an expression once, at a future moment
NEW CRON [RUN op] EVERY n UNIT STARTING NOW|?datetime SET ?jobRun an expression repeatedly, on an interval
SCHEDULE/CRON LIST / DESCRIBE / DELETEJob registry
NEW WATCH TABLE "t" FROM "db" ON "insert"|"update"|"delete" TRIGGER [RUN op] SET ?watchReact 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 / DELETEWatch registry
NEW TRANSCODE STREAM FROM "rtsp://"|"file" FORMAT "hls"|"mse" SET ?streamLive/continuous media streaming
TRANSCODE STREAM ?stream STOPStop a stream
EDITOR OPEN "path" SET ?docOpen a file for text/code editing
NEW EDITOR [AS "lang"] SET ?docStart 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/LANGFull text editor verb set
EDITOR ?doc SELECT BLOCK FROM LINE n COL n TO LINE n COL nRectangular/column block selection, distinct from linear FROM..TO
EDITOR ?doc OUTDENT LINE n / SELECTION ?sel OUTDENTRemove one indent level
EDITOR ?doc BOOKMARK LINE n / BOOKMARK REMOVE LINE n / BOOKMARKS SET ?linesSet, remove, and list line bookmarks
EDITOR ?doc TRIM TRAILING WHITESPACERemove 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 TABSIndentation 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...CLOSEDefine a class
SPAWN Name WITH "prop" AS val AND ... SET ?instanceInstantiate a class
CALL "method" ON ?instanceInvoke an instance method — THIS bound inside
EXTENDS ParentClassClass inheritance, child overrides same-named members
NEW QUERY "word" CASE "sensitive" SEPARATOR "." OPEN...CLOSERegister a custom natural-language phrase-tree command
SKIPPABLEMarks 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|PASSWORDFull end-user accounts system, see Accounts System
CHAT WITH "n" PEERS "a" AND "b"... SET ?roomCreate a chat room
CHAT ENTRY FROM "user" MESSAGE `text` TO ?room SET ?msgSend a chat message
DIRECTIVE "id" EXEC "cmd" [BACKGROUND] SET ?r / KILL ?pidRemote shell execution
DIRECTIVE "id" DOWNLOAD/UPLOAD "path" TO "path" SET ?h / STATUS ?hRemote file transfer with progress
DIRECTIVE "id" SCREENSHOT / WAKERemote screen capture / Wake-on-LAN
DIRECTIVE "id" SERVE "path" SET ?srcServe 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 ?tunnelExpose a local port publicly with no port forwarding
DIRECTIVE PEERS "id" AND "id" SET ?networkGroup machines into a peer network
DIRECTIVE NETWORK ?network TRANSFER FROM "id://path" TO "id://path" SET ?anchorDirect machine-to-machine file transfer, non-blocking
DIRECTIVE STATUS ?anchor SET ?progressPeer transfer progress
DIRECTIVE "id" POLL n SECONDS|MINUTESAgent check-in interval, 1 SECOND to 60 MINUTES
DIRECTIVE NETWORK ?n SHARE "id" PORT n AS n SET ?statusExpose a peer's port on every other peer's localhost
DIRECTIVE "id" LIST FROM "path" / LIST DRIVESBrowse the machine's folders and drives
DIRECTIVE LIST / STATUS "id"Agent registry
SUBDOMAIN ADD "name" [ON "tld.com"] [AT "path"] SET ?resultRegister a subdomain — ON puts it on a pointed domain, AT chooses the folder, default /root/sites/{subdomain}
SUBDOMAIN REMOVE/LIST/SEARCH "name" SET ?resultocalt.site subdomain management
DOMAIN "tld.com" TO "subdomain.ocalt.site" SET ?varPoint a domain you own at a subdomain or tunnel — ?var("status"), ?var("message")
DOMAIN STATUS "tld.com" SET ?statusCurrent pointing state and reason
DOMAIN SSL "tld.com" SET ?sslIssue and track the certificate — already in progress | failed try again | successful - certificate is live
SET PERSISTENT ?var AS val / typed-verb form / EMIT PERSISTENT ?varCross-request value with no expiry, scoped to the session — PERSISTENT is written on every use
START PERSIST / KILL PERSISTStanding 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 ?roomWebRTC 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 ?sessionStart a headless browser automation session
BROWSER ?s NAVIGATE/CLICK/TYPE/SELECT/HOVER/UPLOAD/CLEAR/SCROLL/BACK/FORWARD/RELOAD/CLOSEPage interaction
BROWSER ?s READ/EXTRACT/EVALUATEContent extraction and raw JS execution
BROWSER ?s WAIT n / WAIT FOR selector/text/NETWORKExplicit and conditional waits
BROWSER ?s TAB NEXT|PREV / FOCUS CHECKKeyboard tab-order interaction
BROWSER ?s STORAGE READ|WRITE / COOKIES / COOKIE WRITE / AUTHStorage, cookies, HTTP auth
BROWSER ?s VIEWPORT / MOBILE "device"Viewport size and device emulation
BROWSER ?s SCREENSHOT / PDF / DOWNLOAD / NETWORK LOG / INTERCEPT / STREAM TOCapture, network inspection, live frame streaming
SSH "user" AT "host" PASSWORD|KEY "..." [ON "port"] ENTER `cmd` SET ?resultRemote 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 ?resultExecute embedded PHP or a WASM module
NEW EVENT "title" ON "date" FROM/TO TIMEZONE WITH DESCRIPTION/ATTENDEES AT LOCATION REMIND SET ?evCreate 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 actionAttach an action to fire alongside a reminder
GET EVENTS TODAY|THIS WEEK|THIS MONTH|FROM..TO / GET NEXT EVENT / GET EVENT ?idQuery events
GET EVENTS ... WHERE ...Filter event queries
UPDATE ?ev SET TITLE TO / MOVE TO / ADD ATTENDEE / REMOVE ATTENDEEModify 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 CALENDARCalendar management
CHECK AVAILABILITY FROM..TO FOR n MINUTES SET ?slots / BOOK SLOTScheduling/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 ?filePackage 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.jsonExternal app metadata file read by APPLICATE

Conditions, Loops & Operators

Verb Description
IF condition OPEN...CLOSE OR OPEN...CLOSEIf/else — OR branch runs when condition is false
OR IF condition OPEN...CLOSEChained else-if
IS EQUAL TO / IS NOT EQUAL TOLoose value equality
IS IDENTICAL TO / IS NOT IDENTICAL TOStrict/type-sensitive equality
IS GREATER THAN / IS LESS THANNumeric comparison
IS GREATER THAN OR EQUAL TO / IS LESS THAN OR EQUAL TOInclusive numeric comparison
CONTAINS "substr"Substring/containment check
IS SET / IS NOT SETVariable existence
IS EMPTY / IS NOT EMPTYEmpty string/array/object check
IS NULL / IS NOT NULLNull check
... AND ... / ... OR ... (inside a condition)Combine multiple conditions in one IF
?arr ARE EQUAL TO xTrue only if every element matches
SOME ?arr ARE EQUAL TO xTrue if at least one element matches
SOME ?arr ARE GREATER/LESS THAN xAt-least-one numeric match across an array/object
!THIS('some')Inside a SOME/ARE block — the matching indices/keys
WHILE condition OPEN...CLOSELoop while a condition holds
WHILE SOME ?arr ARE ...Loop while at least one element matches
LOOP a TO b SET ?i OPEN...CLOSECounted loop, ascending
LOOP a TO b STEP n SET ?iCounted loop with a custom step
LOOP b TO a STEP -n SET ?iDescending counted loop
LOOP INFINITE OPEN...CLOSEInfinite loop — deliberately never terminates
BREAKExit the current LOOP/WHILE early
CONTINUESkip to the next LOOP/WHILE iteration
SWITCH ?var OPEN CASE "v" ... BREAK ... DEFAULT ... CLOSEMulti-branch dispatch
CASE "a" CASE "b" (no BREAK between)Fallthrough — multiple case values share one body

Execution States

Verb Description
?var IS true / IS falseExplicit boolean state
?var IS NULLNever declared, or explicitly returned as null
?var IS EMPTYDeclared but holds an empty string/array/object
?var IS WAITINGA PROMISE that has not yet resolved
?var IS INFINITEA PROMISE whose connection broke — will never resolve
LOOP INFINITEDeliberate infinite-loop execution state

Math & CALCULATE

Verb Description
CALCULATE expr SET ?resultEvaluate 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 ?rNamed single-argument computations
COMPUTE power|mod OF a AND b SET ?rNamed two-argument computations
ADD a TO b SET ?ansNatural-language addition
SUBTRACT a FROM b SET ?ansNatural-language subtraction
MULTIPLY a BY|WITH b SET ?ansNatural-language multiplication — BY/WITH interchangeable
DIVIDE a BY b SET ?ansNatural-language division
SQUARE ROOT OF n SET ?ansNatural-language square root
LOGARITHM OF n [BASE b] SET ?ansNatural log by default, or a specified base
FIBONACCI OF n / FACTORIAL OF n / PRIME OF n SET ?ansNatural-language named computations
ABSOLUTE VALUE OF n / ROUND OF n / FLOOR OF n / CEILING OF n SET ?ansNatural-language rounding functions
RAISE a TO b SET ?ansNatural-language exponentiation
MODULO a BY b SET ?ansNatural-language modulo
[expr] nested inlineBracket syntax nests any expression inline as a value, e.g. inside another CALCULATE/MULTIPLY
!THATAuto-updating result of the last statement — chains naturally through ADD/MULTIPLY/etc.

Strings

Verb Description
STRING "text" SET ?varDeclare a string, supports & concatenation inline
LENGTH ?str SET ?nString length
STRING UPPERCASE ?str / STRING LOWERCASE ?str SET ?outCase conversion
TRIM STRING ?str SET ?outTrim whitespace
REVERSE STRING ?str SET ?outReverse a string
REPLACE STRING ALL "a" WITH "b" WHERE "text" SET ?outReplace 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 ?posFind substring position, or null
SELECT STRING "text" FROM n TO n SET ?subSubstring by position range
SPLIT "text" BY "," SET ?partsSplit into an array by separator (empty separator splits into characters)

Arrays, Objects & Multiarrays

Verb Description
NEW ARRAY SET ?arr / APPEND val TO ?arrCreate an array and append values
?arr(n)Index access
COUNT ?arr SET ?nElement count
REMOVE KEY n FROM ?arr SET ?arrRemove by index, array repacks automatically
REVERSE ARRAY ?arr SET ?revReverse order
SEARCH ARRAY ?arr FOR val SET ?foundFind index of a value, or null
JOIN ?arr [WITH "sep"] SET ?strJoin into a string, separator optional. JOIN ARRAY is an accepted alias
SLICE ?arr FROM n TO n SET ?subSubset by index range
SORT ?arr SET ?sortedSort ascending
MERGE ARRAY ?a WITH ?b SET ?combinedConcatenate two arrays
DEDUPLICATE ?arr SET ?uniqueRemove duplicate values
NEW OBJECT SET ?obj / SET ?obj("key") AS valCreate an object and set keys
?obj("key") / "key" OF ?objTwo equivalent access notations
COUNT ?obj SET ?nProperty count
REMOVE KEY "k" FROM ?obj SET ?objRemove a property entirely — not null, gone
KEYS ?obj SET ?arr / VALUES ?obj SET ?arrList all keys / all values
APPEND "key" AS val TO ?objAdd a property via APPEND form
SEARCH OBJECT ?obj FOR val SET ?keyFind the key holding a value, or null
MERGE OBJECT ?a WITH ?b SET ?combinedMerge two objects — right side wins on key collision
NEW OBJECT ["k" AS v AND "k2" AS v2] SET ?objInline object literal
[item1 AND item2 AND item3]Inline array literal
FOREACH ?arr SET ?value OPEN...CLOSEIterate an array's values
FOREACH ?arr SET ?key AS ?valueIterate with index/key and value
FOREACH ?obj SET ?key AS ?valueIterate an object's properties
NEW MULTIARRAY SET ?m / APPEND ?row TO ?mArray-of-arrays for grid/nested data
?m(row)(col) / col OF row OF ?mTwo equivalent nested-access notations
FLATTEN ?m SET ?flatCollapse a multiarray into one flat array

Date & Time

Verb Description
NEW DATE / NEW TIME / NEW DATE AND TIME SET ?varCurrent 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|YEARDate arithmetic
CALCULATE ?dt +/- n MINUTES|HOURSDatetime arithmetic
CALCULATE ?date FIRST DAY / LAST DAYFirst/last day of the month
GET ?date DAY FULLNAME|SHORTNAME / MONTH FULLNAME|SHORTNAMENamed day/month components
GET ?dt YEAR|MONTH|DAY|HOUR|MINUTE|SECONDNumeric components
GET ?dt TIMESTAMP SET ?unixUnix timestamp
FORMAT DATE|TIME|DATE AND TIME ?var AS "pattern" SET ?strCustom format string
CALCULATE ?a - ?b AS days|hours|years SET ?diffDifference between two dates, in a chosen unit
CONVERT TIMEZONE ?dt TO "tz" SET ?convertedTimezone conversion
RANDOMIZE DATE|TIME|DATE AND TIME FROM RANGE "a" TO "b" SET ?rRandom 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 ?jobAny CONVERT can run in the background — WAIT FOR to collect
CAST ?var AS STRING|NUMBER|BOOL|DATE|JSON|OQLOBJECTType conversion between OQL values
CAST ?date FROM "pattern"Custom input format when casting to DATE
ENCODE ?str AS BASE64|URL|HEX SET ?outEncode a string
DECODE ?str AS BASE64|URL|HEX SET ?outDecode a string
FORMAT NUMBER ?n WITH n DECIMALS SET ?strFixed decimal places
FORMAT NUMBER ?n AS INTEGER|SCIENTIFIC|CURRENCY SET ?strOther number formats
PARSE ?str AS JSON|OQLOBJECT|CSV|XML|YAML|TOML|QUERY STRING|HTML|MARKDOWN SET ?outParse 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 ?hashOne-way hash
ENCRYPT ?str USING ?key AS aes|chacha20|des SET ?outSymmetric encryption
DECRYPT ?str USING ?key AS aes|chacha20|des SET ?outSymmetric decryption
GENERATE KEY AS aes|chacha20|rsa|ecc SET ?keyGenerate a cryptographic key
GENERATE UUID SET ?idGenerate a UUID
RANDOMIZE FROM RANGE a TO b AS integer|decimal [PLACES n] SET ?rRandom number in a range
RANDOMIZE STRING LENGTH n AS alphanumeric|hex|numeric|uppercase|lowercase SET ?rRandom string of a given charset
RANDOMIZE FROM STRING "charset" [LENGTH n] SET ?rRandom string from a custom charset

HTTP, Network & Sockets

Verb Description
FETCH "url" SET ?dataBasic GET request
FETCH "url" SET PROMISE ?dataNon-blocking fetch — collect later with WAIT FOR
... METHOD "post" BODY "..." HEADER "..." TIMEOUT n SECONDSFETCH 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 DATACapture status code and body separately
CURL ...Direct alias for FETCH, identical modifiers
STATUS nSet the HTTP response status code — does not stop execution
WEBSOCKET "wss://..." SET ?ws / SEND ?ws "msg" / RECEIVE ?ws SET ?msg / CLOSE ?wsRaw WebSocket client
TCP "host" PORT n SET ?tcp / SEND / RECEIVERaw 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]" CLOSEBuild an image pixel-by-pixel from scratch
IMAGE LOAD "path or url" SET ?imgLoad an existing image
GRAPHIC ?img EXPORT AS "png"|"jpg"|"bmp"|"webp"|"gif" SET ?bytesExport to a format
GRAPHIC ?img RESIZE WIDTH w [HEIGHT h] SET ?imgResize, aspect-preserved if height omitted
GRAPHIC ?img CROP POSITION X n Y n WIDTH w HEIGHT hCrop
GRAPHIC ?img ROTATE n / FLIP HORIZONTAL|VERTICALRotate/flip
GRAPHIC ?img THUMBNAIL WIDTH w HEIGHT hGenerate a thumbnail
GRAPHIC ?img FILTER AS GREYSCALE|SEPIA|BLUR|SHARPEN|INVERTApply a filter, optionally scoped to a selection
GRAPHIC ?img SELECT RECTANGLE|ELLIPSE|LASSO|COLOR ... SET ?selMake 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 ?colorSample a pixel's color
GRAPHIC ?img TEXT "..." POSITION FONT SIZE COLOR WEIGHT OUTLINE SHADOW BACKGROUNDDraw text onto an image
GRAPHIC ?img WATERMARK WITH "text"|?logo_imgApply a watermark
GRAPHIC ?img COMPOSITE WITH ?overlay AT X n Y nComposite one image onto another
GRAPHIC ?img REMOVE BACKGROUNDBackground removal
GRAPHIC ?img HISTOGRAM SET ?dataRGB histogram data
NEW GRAPHIC LAYER SET ?layer / GRAPHIC ?img ADD LAYER ?layerLayer system
GRAPHIC ?layer ORDER ABOVE|BELOW / OPACITY n / BLEND "mode" / HIDE / SHOWLayer stacking and blending
GRAPHIC ?img FLATTEN SET ?finalMerge 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 ?mediaLoad a video/audio file
MEDIA ?media PROBE [VIDEO|AUDIO] SET ?infoInspect codec/format/duration metadata
MEDIA ?media EXPORT AS "format" SET ?outExport to mp4/webm/avi/mkv/mov/gif/mp3/wav/ogg/flac/aac
MEDIA ?media TRANSCODE AS "format" SET ?outTranscode to another container/codec
MEDIA ?media SCALE WIDTH w [HEIGHT h] SET ?outResize video, aspect-preserved if height omitted
MEDIA ?media SPEED n SET ?outPlayback speed, audio pitch auto-corrected
MEDIA ?media TRIM FROM "hh:mm:ss" TO "hh:mm:ss" SET ?clipCut a clip
MEDIA ?a SPLICE WITH ?b SET ?joinedConcatenate clips
MEDIA ?media EXTRACT FRAME AT "time" SET ?frameGrab a single still frame
MEDIA ?media INSERT FRAME ?img AT "time" DURATION n SET ?outInsert 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..TOReplace a frame range with an image
MEDIA ?media REPLACE CLIP WITH ?clip FROM..TOReplace a clip range
MEDIA ?media EXTRACT AUDIO SET ?audio / REPLACE AUDIO WITH ?a / MUTEAudio track manipulation
MEDIA ?audio NORMALIZE / VOLUME n / PITCH nAudio level and pitch
MEDIA ?a MIX WITH ?b SET ?mixedMix two audio tracks
MEDIA ?media FADE IN|OUT DURATION n FROM nAudio/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 FONTDraw text onto video
MEDIA ?media BLUR RADIUS n / COLOR GRADE CONTRAST SATURATION BRIGHTNESS GAMMAVisual effects and color grading
MEDIA ?media MIRROR HORIZONTAL|VERTICAL / REVERSE / STABILIZEFlip, reverse playback, stabilize shake
MEDIA ?media FREEZE FRAME AT "time" DURATION n / BOOMERANG / LOOP TIMES nFreeze-frame, boomerang, repeat
MEDIA ?media GREEN SCREEN WITH ?bg KEY "0xHEX" SIMILARITY n BLEND nChroma key compositing
MEDIA ?a SPLIT SCREEN WITH ?b HORIZONTAL|VERTICALSide-by-side/stacked composite
MEDIA ?a TRANSITION WITH ?b DURATION n SET ?finalCross-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 ?finalPlace clips on tracks, render the final composite
MEDIA ?media SPEED RAMP FROM..TO RATE nVariable 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 ?accCreate 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 ?connConnect 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 ?msgFetch a specific message by UID
EMAIL ?conn MARK uid AS READ|UNREAD|FLAGGED|UNFLAGGED|DELETEDChange 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 LABELGmail-style label management
EMAIL ?conn SAVE DRAFT TO ... SUBJECT ... BODY ...Save a draft
EMAIL ?conn SEND TO ... CC BCC SUBJECT BODY REPLY TO HEADER ATTACHSend via an open IMAP connection
EMAIL ?conn CLOSEClose the connection
NEW EMAIL POP3 "host" WITH "password" AS "user" SET ?connConnect to a POP3 mailbox
EMAIL ?conn LIST SET ?messagesList messages (uid, size only — full fields need UID fetch)
EMAIL ?conn DELETE uidDelete a message

Cache, Remember & Timing

Verb Description
REMEMBER "key" AS valStore a value in namespace-persistent key/value storage, no expiry
RECALL "key" SET ?varRead a remembered value, or null
FORGET "key"Delete a remembered value
CACHE STORE "key" AS val TTL n SECONDS|MINUTES|HOURStore with an expiry
CACHE GET "key" SET ?varRead a cached value, null if expired/missing
CACHE REMOVE "key"Delete a cached value early
SLEEP n MILLISECONDS|SECONDS|MINUTES|HOURBlock execution for a fixed duration
FETCH "url" SET PROMISE ?varStart an async operation without blocking
WAIT FOR ?promise [n SECONDS] SET ?resultBlock until a promise resolves, optional timeout
?promise IS SET|EMPTY|WAITING|INFINITEPromise state checks