quant function, filter, auth, functions
The Content CLI ships five related commands for managing edge code on QuantCDN: three for deploying individual edge functions (function, filter, auth), one for deploying multiple at once from a manifest (functions), and one for adding an entry to a manifest (functions-add).
For an overview of what edge functions are and when to use them, see the Edge Functions docs.
| Command | Use when |
|---|---|
quant function |
Deploying a single edge function. |
quant filter |
Deploying a single edge filter function (modifies requests/responses). |
quant auth |
Deploying a single edge auth function (authentication/authorisation logic). |
quant functions |
Deploying many functions in one go from a JSON manifest. |
quant functions-add |
Adding a function to a manifest with a new UUID. Uploads nothing. |
Function identity
Section titled “Function identity”A function’s UUID is its identity. You choose it, commit it, and never change it. The first deploy with a UUID creates the function; every later deploy with the same UUID updates it. A different UUID is a different function: the old one stays deployed, and rules and {{QUANT_FN:...}} tokens that name it keep running it. A UUID is scoped to its project, so sites created from one template can commit the same UUIDs. Every deploy publishes the function at once.
From CLI 7.0.0 (and quantcdn/deploy-action v7):
quant function,quant filterandquant authrequire theuuidargument.quant functionsrequires auuidon every manifest entry. It checks the whole manifest before it uploads anything.- No command derives a UUID from a name, a path or the project.
Create a UUID with quant functions-add, or with any UUID generator (for example uuidgen | tr A-Z a-z).
quant function
Section titled “quant function”Deploy a single edge function.
Synopsis
Section titled “Synopsis”quant function <file> <description> <uuid> [options]Arguments
Section titled “Arguments”| Name | Description |
|---|---|
file |
Path to the function file (required). |
description |
Human-readable description of the function (required). |
uuid |
The function’s UUID (required). Creates the function on the first deploy, updates it after. |
Examples
Section titled “Examples”# Deploy (create or update) the function with this UUIDquant function handler.js "Homepage personalisation" 019361ae-2516-788a-8f50-e803ff561c34quant filter
Section titled “quant filter”Deploy a single edge filter function. Filter functions run on the request/response path and can modify headers, rewrite URLs, or short-circuit responses.
Synopsis
Section titled “Synopsis”quant filter <file> <description> <uuid> [options]Arguments
Section titled “Arguments”| Name | Description |
|---|---|
file |
Path to the filter function file (required). |
description |
Human-readable description (required). |
uuid |
The filter’s UUID (required). Creates the filter on the first deploy, updates it after. |
Examples
Section titled “Examples”quant filter filter.js "Strip tracking params" 019361ae-2516-788a-8f50-e803ff561c34quant auth
Section titled “quant auth”Deploy a single edge auth function. Auth functions evaluate requests and decide whether they should be allowed through to origin. Return status 201 to let the request continue. Any other response is sent to the client and the request stops.
Synopsis
Section titled “Synopsis”quant auth <file> <description> <uuid> [options]Arguments
Section titled “Arguments”| Name | Description |
|---|---|
file |
Path to the auth function file (required). |
description |
Human-readable description (required). |
uuid |
The auth function’s UUID (required). Creates the function on the first deploy, updates it after. |
Examples
Section titled “Examples”quant auth auth.js "JWT gate for /admin" 019361ae-2516-788a-8f50-e803ff561c34quant functions (bulk)
Section titled “quant functions (bulk)”Deploy multiple functions in a single command using a JSON manifest. Useful in CI when several functions ship together.
Synopsis
Section titled “Synopsis”quant functions <file> [options]Arguments
Section titled “Arguments”| Name | Description |
|---|---|
file |
Path to the JSON manifest describing the functions to deploy (required). |
Examples
Section titled “Examples”quant functions quant/edge-functions.jsonManifest format
Section titled “Manifest format”The manifest is a JSON array. Each entry has these fields:
| Field | Required | Rule |
|---|---|---|
uuid |
Yes | UUID shape (8-4-4-4-12 hex), unique in the manifest. The function’s identity. |
path |
Yes | The function source file, relative to the directory where you run the command (the repository root in the deploy action). |
type |
Yes | function, filter or auth. edge is accepted as another name for function. |
description |
Yes | Shown in the dashboard. |
id |
No | Lowercase slug (^[a-z][a-z0-9-]{0,47}$), unique in the manifest. A name that edge rules reference with function_ref (quant rules --functions, or the deploy action’s rules input). |
[ { "type": "function", "id": "homepage", "uuid": "43aec1f0-095b-4a76-a9c8-934bf3d49d59", "path": "quant/edge-functions/handler.js", "description": "Homepage personalisation" }, { "type": "filter", "uuid": "019361ae-2516-788a-8f50-e803ff561c34", "path": "quant/edge-functions/filter.js", "description": "Strip tracking params" }]If any entry is not valid, the command lists every problem and uploads nothing. A manifest that is not an array (for example {}) is refused.
Quant templates and Quant Studio keep the manifest at quant/edge-functions.json and the bodies in quant/edge-functions/. Studio publish checks each entry with the same rules, but it skips an entry that fails them, names it on the Deployments page, and deploys the other entries.
quant functions-add
Section titled “quant functions-add”Add a function to a manifest with a new version 4 UUID. It uploads nothing. Commit the manifest, then deploy with quant functions or the deploy action.
Synopsis
Section titled “Synopsis”quant functions-add <manifest> <path> --description <text> [--type <type>] [--id <id>]Arguments
Section titled “Arguments”| Name | Description |
|---|---|
manifest |
The function manifest. It is created if it does not exist. |
path |
The function file, relative to the current directory. The file must exist. |
--description |
Description shown in the dashboard (required). |
--type |
function (default), filter or auth. |
--id |
Optional name for rules to reference (function_ref). |
The command refuses a path or id that the manifest already has. It also refuses an existing manifest that is not valid, for example a 6.x manifest with an entry that has no uuid: add the missing UUIDs first. It writes the manifest in one step, so a failure never leaves a partial file. It prints only the new UUID on stdout, so a script can capture it; the confirmation message goes to stderr.
Examples
Section titled “Examples”quant functions-add quant/edge-functions.json quant/edge-functions/api.js --description "Workspace API" --id api-v1See also
Section titled “See also”- Edge Functions — concepts and capabilities.
quant waflogs— inspect WAF events triggered by edge code.
