Skip to main content
Quartz provides a comprehensive command-line interface for managing your static site. All commands are executed using the npx quartz prefix.

Available Commands

Quartz CLI offers five main commands for different stages of your workflow:

create

Initialize a new Quartz project with content setup options

build

Build your Quartz site into static HTML files

sync

Synchronize your content with GitHub repositories

update

Update Quartz to the latest version

restore

Restore your content folder from cache

Quick Start

1

Initialize Quartz

npx quartz create
Set up your Quartz project with interactive prompts for content strategy.
2

Build and preview

npx quartz build --serve
Build your site and start a local development server.
3

Sync to GitHub

npx quartz sync
Commit and push your changes to your repository.

Global Options

These options are available across most Quartz commands:
--directory
string
default:"content"
Directory to look for content files. Can be specified as an absolute or relative path.Alias: -d
npx quartz build --directory ./my-notes
--verbose
boolean
default:"false"
Print out extra logging information for debugging purposes.Alias: -v
npx quartz build --verbose

Command Reference

create

Initialize a new Quartz installation with content setup options.
npx quartz create [options]
The create command initializes a new Quartz project with various setup strategies.

build

Build your Quartz site into a bundle of static HTML files.
npx quartz build [options]
Learn more →

sync

Synchronize your Quartz content to and from GitHub.
npx quartz sync [options]
Learn more →

update

Pull the latest Quartz framework updates from upstream.
npx quartz update [options]
This command backs up your content, pulls updates from the upstream Quartz repository, and restores your content. You may need to resolve git conflicts if you’ve customized components or plugins.

restore

Restore your content folder from the cache.
npx quartz restore [options]
This command is typically used after an interrupted update or sync operation to recover your content from the cache.

Version Information

Check the installed Quartz version:
npx quartz --version

Getting Help

Display help information for any command:
# General help
npx quartz --help

# Command-specific help
npx quartz build --help
npx quartz sync --help

Common Workflows

Local Development

# Start development server with hot reload
npx quartz build --serve
This starts a local server at http://localhost:8080 and automatically rebuilds when you make changes.

Production Build

# Build for production
npx quartz build

# The output will be in the ./public directory by default

Deploy Workflow

# Build, commit, and push changes
npx quartz build
npx quartz sync

Environment

All commands run in the current working directory and expect a valid Quartz project structure with:
  • quartz.config.ts - Configuration file
  • content/ - Content directory (or custom path via --directory)
  • quartz/ - Framework directory

Exit Codes

  • 0 - Success
  • 1 - Error occurred (check console output for details)

Next Steps

Build Command

Learn about build options and local development

Sync Command

Explore git synchronization features

Build docs developers (and LLMs) love