Skip to content

Get started with the Quant CLI

The Quant CLI is a command-line tool for deploying static sites and managing content on QuantCDN.

  • Node.js 20 or higher - Check with node --version
  • npm - Included with Node.js

Install the CLI globally via npm:

Terminal window
npm install -g @quantcdn/quant-cli

Verify the installation:

Terminal window
quant --version

Navigate to a directory containing your build output and run:

Terminal window
quant init

You’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.

For CI/CD environments, pass all values as flags:

Terminal window
quant init \
-c "$QUANT_CUSTOMER" \
-t "$QUANT_TOKEN" \
--project="$QUANT_PROJECT" \
-e "https://api.quantcdn.io" \
-d ./dist

Deploy all content from your configured directory:

Terminal window
quant deploy

This pushes all files that have changed since the previous deployment. By default, content removed locally will be unpublished from the CDN.

OptionDescription
--revision-log <path>Track MD5 hashes locally for faster incremental deploys
--skip-unpublishDon’t unpublish removed content
--skip-unpublish-regex <pattern>Skip unpublish for paths matching pattern
--skip-purgeSkip automatic cache purge
--chunk-size <n>Concurrent uploads (default 10, max 20)
--forcePush all assets even if hashes match
--enable-index-htmlInclude index.html in URLs
--attachmentsProcess attachments
Terminal window
quant deploy --revision-log .quant-revision --skip-purge
CommandDescription
quant initInitialise project configuration
quant infoDisplay current project configuration
CommandDescription
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
CommandDescription
quant purge <path>Purge CDN cache for a URL pattern
CommandDescription
quant redirect <from> <to> [status]Create a redirect rule
CommandDescription
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
CommandDescription
quant search statusCheck search index status
quant search index --path=<file>Index search records
quant search unindexRemove from search index
quant search clearClear the entire search index
CommandDescription
quant scanValidate local file checksums against deployed content
quant waf:logsAccess project WAF logs
Terminal window
quant file ./images/logo.png /images/logo.png
Terminal window
quant redirect /old-page /new-page 301
Terminal window
quant purge "/blog/*"
Terminal window
quant function ./my-function.js "My edge function"

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.

The quant.json file stores your project configuration:

{
"endpoint": "https://api.quantcdn.io",
"clientid": "your-org",
"project": "your-project",
"token": "your-token",
"dir": "dist"
}