CLI & Operations
Every subcommand, flag, backup command, and common operational fix for quarkd v0.5.1.
Global option
Every subcommand accepts -c, --config <PATH> (default: quarkd.toml).
Subcommands (12)
| Command | Flags | Purpose |
|---|---|---|
quarkd init | --mode standalone|server|agent, --force | Generate a starter TOML config with fresh random tokens. |
quarkd standalone | --config | Run all-in-one server, dashboard, MCP, and local log tailers. |
quarkd server | --config | Run hub receiving agent batches + JS beacons. |
quarkd agent | --config | Run agent daemon tailing logs into a bounded spool and shipping zstd batches. |
quarkd doctor | --json | Verify config syntax, log readability, DB/spool health, GeoIP, and hub reachability. |
quarkd status | --json | Print agent spool depth or hub fleet status. |
quarkd query | --site, --hours, --limit, --remote, --json | Query analytics directly from local SQLite or a remote hub. |
quarkd snippet <TARGET> | nginx, nginx-proxy, caddy, caddy-proxy, logrotate, systemd-server, systemd-agent, script | Print ready-to-drop config snippets. |
quarkd backup | -o, --output <PATH>, --force | Take an atomic online SQLite WAL snapshot without stopping the server. |
quarkd config-import | --config | Copy TOML sites, goals, and webhooks into SQLite for UI/MCP ownership. |
quarkd hash-password | interactive TTY or stdin | Generate an Argon2id admin_password_hash line for server.toml. |
quarkd geoip-update | --dir <DIR>, --force | Download or refresh DB-IP City Lite and ASN Lite .mmdb files. |
quarkd test-hit | --url, --site, --token, --json | Fire synthetic server + JS + AI-crawler hits to verify ingestion and dedup. |
Online SQLite backups
Run quarkd backup from cron or systemd timers while quarkd stays online and ingesting:
Shell
quarkd --config /etc/quarkd/server.toml backup --output /var/backups/quarkd-$(date +%F).db
Expected outputOutput
Backup written to /var/backups/quarkd-2026-12-05.db (consistent WAL snapshot)
Common errors & fixes
| Symptom | Cause | Fix |
|---|---|---|
Pageviews: 0 while Server requests > 0 |
Site is log-only or /_q.js is blocked/missing. |
Run Check q.js in Overview (or probe_sites over MCP) and verify the script tag and proxy route. |
agent_offline webhook fires |
Edge agent stopped or cannot reach hub /ingest/v1/batch. |
Check quarkd status --json on the edge host; events are safely buffered in the bounded SQLite spool until connectivity returns. |
| All visitors show the proxy's country/IP | Reverse proxy CIDR is not in trusted_proxies. |
Add your proxy/CDN CIDR to [server].trusted_proxies and pass X-Forwarded-For. |
409 Conflict when editing a site via MCP |
Site is still declared in server.toml. |
Run quarkd config-import, remove the [[sites]] block from TOML, and restart once. |