Get started with the Quant CLI
The Quant CLI is a command-line tool for deploying static sites and managing content on QuantCDN.
Requirements
Section titled “Requirements”- Node.js 20 or higher - Check with
node --version - npm - Included with Node.js
Install
Section titled “Install”Install the CLI globally via npm:
npm install -g @quantcdn/quant-cliVerify the installation:
quant --versionInitialise a project
Section titled “Initialise a project”Navigate to a directory containing your build output and run:
quant initYou’ll be prompted for:
- QuantCDN endpoint: Use the default
https://api.quantcdn.io - Client ID: Your organisation ID (from your dashboard URL)
- Project: The project machine name
- Token: Your project API token (from Integrations section)
- Directory: The folder containing your static assets (e.g.,
dist,build,public)
This creates a quant.json configuration file in the current directory.
Non-interactive initialisation
Section titled “Non-interactive initialisation”For CI/CD environments, pass all values as flags:
quant init \ -c "$QUANT_CUSTOMER" \ -t "$QUANT_TOKEN" \ --project="$QUANT_PROJECT" \ -e "https://api.quantcdn.io" \ -d ./distDeploy content
Section titled “Deploy content”Deploy all content from your configured directory:
quant deployThis pushes all files that have changed since the previous deployment. By default, content removed locally will be unpublished from the CDN.
Deploy options
Section titled “Deploy options”| Option | Description |
|---|---|
--revision-log <path> | Track MD5 hashes locally for faster incremental deploys |
--skip-unpublish | Don’t unpublish removed content |
--skip-unpublish-regex <pattern> | Skip unpublish for paths matching pattern |
--skip-purge | Skip automatic cache purge |
--chunk-size <n> | Concurrent uploads (default 10, max 20) |
--force | Push all assets even if hashes match |
--enable-index-html | Include index.html in URLs |
--attachments | Process attachments |
Recommended usage
Section titled “Recommended usage”quant deploy --revision-log .quant-revision --skip-purgeAvailable commands
Section titled “Available commands”Configuration
Section titled “Configuration”| Command | Description |
|---|---|
quant init | Initialise project configuration |
quant info | Display current project configuration |
Content management
Section titled “Content management”| Command | Description |
|---|---|
quant deploy [dir] | Deploy static site output |
quant file <file> <location> | Deploy a single asset |
quant page <file> <location> | Deploy a single HTML page |
quant publish <path> | Publish an asset (make live) |
quant unpublish <path> | Unpublish an asset (remove from CDN) |
quant delete <path> | Permanently delete a deployed path |
Cache management
Section titled “Cache management”| Command | Description |
|---|---|
quant purge <path> | Purge CDN cache for a URL pattern |
Redirects
Section titled “Redirects”| Command | Description |
|---|---|
quant redirect <from> <to> [status] | Create a redirect rule |
Edge functions
Section titled “Edge functions”| Command | Description |
|---|---|
quant function <file> <description> | Deploy an edge function |
quant filter <file> <description> | Deploy a content filter function |
quant auth <file> <description> | Deploy an auth middleware function |
Search
Section titled “Search”| Command | Description |
|---|---|
quant search status | Check search index status |
quant search index --path=<file> | Index search records |
quant search unindex | Remove from search index |
quant search clear | Clear the entire search index |
Validation and monitoring
Section titled “Validation and monitoring”| Command | Description |
|---|---|
quant scan | Validate local file checksums against deployed content |
quant waf:logs | Access project WAF logs |
Examples
Section titled “Examples”Deploy a single file
Section titled “Deploy a single file”quant file ./images/logo.png /images/logo.pngCreate a redirect
Section titled “Create a redirect”quant redirect /old-page /new-page 301Purge specific paths
Section titled “Purge specific paths”quant purge "/blog/*"Deploy an edge function
Section titled “Deploy an edge function”quant function ./my-function.js "My edge function"Static site generators
Section titled “Static site generators”The CLI works with any static site generator that outputs HTML, CSS, JavaScript, and assets to a build directory:
- Astro -
dist/ - Next.js (static export) -
out/ - Gatsby -
public/ - Hugo -
public/ - Jekyll -
_site/ - Eleventy -
_site/ - Docusaurus -
build/ - VitePress -
.vitepress/dist/ - MkDocs -
site/
Point the CLI at your generator’s output directory during quant init.
Configuration file
Section titled “Configuration file”The quant.json file stores your project configuration:
{ "endpoint": "https://api.quantcdn.io", "clientid": "your-org", "project": "your-project", "token": "your-token", "dir": "dist"}Next steps
Section titled “Next steps”- CI/CD pipelines - Automate deployments with GitHub Actions, GitLab CI, and more
- Edge functions - Deploy serverless functions to the edge