virling Docs
v0.3.0 virling.com GitHub Start free
virling Docs

CLI

virling [--data-dir <DIR>] [COMMAND]
Option and envDefaultWhat it does
--data-dir <DIR>
VIRLING_DATA
./virling-dataFolder for the SQLite and DuckDB files. Works before or after the command.
-h, --helpPrint help.
-V, --versionPrint the version.

Without a command, Virling runs serve with its defaults and environment variables. To pass flags, name the command: virling serve --app.

serve

Runs the server. This is the default command.

virling serve [OPTIONS]
Flag and envDefaultWhat it does
--addr <ADDR>
VIRLING_ADDR
0.0.0.0:8080Address and port to listen on.
--app
VIRLING_APP
offServe sign-in and the app, and run payment sync.
--hosted
VIRLING_HOSTED
offRun as the hosted service, where Agency teams can add seats past the 3 included. Off, a team is capped at 3 users.
--base-url <URL>
VIRLING_BASE_URL
http://localhost:8080Public URL of this server, used in sign-in links and script snippets.
--mcp-url <URL>
VIRLING_MCP_URL
unsetSeparate https origin that serves only the MCP server.
--secret-key <HEX>
VIRLING_SECRET_KEY
unset64 hex characters used to encrypt provider keys. Unset: secret.key in the data folder.
--trust-proxy
VIRLING_TRUST_PROXY
offRead the client IP from X-Forwarded-For.
--events-per-second <N>
VIRLING_EVENTS_PER_SECOND
200Ingest limit per site. Events over it are dropped.
--smtp-url <URL>
VIRLING_SMTP_URL
unsetSMTP server for sign-in emails. Unset: emails are logged.
--mail-from <ADDR>
VIRLING_MAIL_FROM
Virling <login@virling.com>Sender for sign-in emails.
--openai-key <KEY>
VIRLING_OPENAI_KEY
unsetOpenAI key for every site’s AI answers.
--anthropic-key <KEY>
VIRLING_ANTHROPIC_KEY
unsetAnthropic key for AI answers.
--perplexity-key <KEY>
VIRLING_PERPLEXITY_KEY
unsetPerplexity key for AI answers.
--gemini-key <KEY>
VIRLING_GEMINI_KEY
unsetGoogle Gemini key for AI answers.
--openrouter-key <KEY>
VIRLING_OPENROUTER_KEY
unsetOpenRouter key for AI answers, used for each assistant without its own key.
--applications-url <URL>
VIRLING_APPLICATIONS_URL
unsetApplications feed listed in the admin panel.
--applications-token <TOKEN>
VIRLING_APPLICATIONS_TOKEN
unsetBearer token for the applications feed.
--ai-answers-budget-usd <USD>
VIRLING_AI_ANSWERS_BUDGET_USD
unsetEstimated monthly spend after which AI answer runs pause.
--turnstile-site-key <KEY>
VIRLING_TURNSTILE_SITE_KEY
unsetCloudflare Turnstile site key for the sign-in form. Used only with the secret.
--turnstile-secret <KEY>
VIRLING_TURNSTILE_SECRET
unsetCloudflare Turnstile secret key. Used only with the site key.
--marketing
VIRLING_MARKETING
offServe the virling.com landing pages and waitlist. Not needed when self-hosting.
--waitlist-from <ADDR>
VIRLING_WAITLIST_FROM
Rahul at Virling <hello@virling.com>Sender for waitlist emails. Only used with --marketing.
--dodo-api-key <KEY>
VIRLING_DODO_API_KEY
unsetBill the hosted plans through Dodo Payments. Needs --hosted and the other --dodo-* flags. Not needed when self-hosting.
--dodo-api-url <URL>
VIRLING_DODO_API_URL
https://live.dodopayments.comDodo API, or https://test.dodopayments.com for test mode.
--dodo-webhook-secret <SECRET>
VIRLING_DODO_WEBHOOK_SECRET
unsetSigning secret of the Dodo webhook at /api/webhooks/dodo.
--dodo-personal-product <ID>
VIRLING_DODO_PERSONAL_PRODUCT
unsetDodo product for Personal.
--dodo-agency-product <ID>
VIRLING_DODO_AGENCY_PRODUCT
unsetDodo product for Agency.
--dodo-seat-addon <ID>
VIRLING_DODO_SEAT_ADDON
unsetDodo add-on for each Agency user past the 3 included.
--dodo-personal-founding-product <ID>
VIRLING_DODO_PERSONAL_FOUNDING_PRODUCT
unsetDodo product for Personal at the founding price.
--dodo-agency-founding-product <ID>
VIRLING_DODO_AGENCY_FOUNDING_PRODUCT
unsetDodo product for Agency at the founding price.
--founders-url <URL>
VIRLING_FOUNDERS_URL
https://virling.com/api/foundersLookup of founding pre-orders by email.
--founders-token <TOKEN>
VIRLING_FOUNDERS_TOKEN
unsetBearer token for the founders lookup.

A flag on the command line wins over its environment variable. Boolean variables take true or false.

add-site

Adds a site to track, and its owner account if it does not exist.

virling add-site <DOMAIN> --owner <EMAIL> [--timezone <TZ>]
ArgumentDefaultWhat it does
<DOMAIN>The site’s domain. https://, a path and a leading www. are stripped, so https://www.example.com/pricing becomes example.com.
--owner <EMAIL>Owner email, lowercased. The account is created if it does not exist. Sign in with this address.
--timezone <TZ>UTCIANA timezone such as Europe/Berlin. Report days start at midnight in it. The CLI does not check the name, so spell it exactly.
$ virling add-site example.com --owner you@example.com
Added example.com. Script tag:
<script defer src="https://YOUR-VIRLING-HOST/v.js" data-site="example.com"></script>

It fails if the domain is not valid, the email is not valid, or the site already exists. It works while the server is running. New sites are picked up within a minute.

import-ga

Imports daily traffic from Google Analytics 4 CSV exports in one folder as history before tracking began. See Import from Google Analytics.

virling import-ga <DOMAIN> <DIR>

Stop the server first, as for import-plausible below.

import-plausible

Imports daily traffic from an unzipped Plausible CSV export as history before tracking began. See Import from Plausible.

virling import-plausible <DOMAIN> <DIR>
ArgumentWhat it does
<DOMAIN>A site already added to Virling.
<DIR>The folder holding the export’s imported_*.csv files.
$ virling import-plausible example.com ./plausible-export
Imported 4210 daily rows for example.com.

Stop the server first: the import writes to the event database, which the server holds open.

query

Reads reports from a running Virling server through the Read API: totals, revenue by channel, referrer, campaign or page, payments and visitor timelines. It runs anywhere, not only on the server, and does not touch the data folder.

virling query [OPTIONS] <COMMAND>
Flag and envDefaultWhat it does
--url <URL>
VIRLING_URL
http://localhost:8080The Virling server.
--key <KEY>
VIRLING_API_KEY
An API key from Account settings > API keys in the app.
--site <DOMAIN>
VIRLING_SITE
the only siteWhich site to read. Needed when the account has more than one.
--jsonoffPrint the API response as JSON instead of a table. Use it from scripts and AI agents.

Commands that read a range take --range today|7d|30d|90d|12m|all, or --from YYYY-MM-DD --to YYYY-MM-DD for exact local dates. Without them the range is the last 30 days, or since tracking started for a site tracked for 30 days or less.

CommandWhat it prints
sitesThe sites the key can read.
overviewVisitors, revenue, payments, conversion and revenue per visitor, with the previous period and the change.
channelsRevenue by channel.
referrersRevenue by referring domain.
campaignsRevenue by utm_campaign.
landing-pagesRevenue by the first page of each visit.
pagesRevenue by every page viewed.
countries, devicesRevenue by country and by device.
breakdown <DIMENSION>Any dimension of the API, including keyword, browser and os.
retentionCustomers acquired, still paying, net and average LTV, refund rate and 30-day churn by the first payment’s channel. Takes --by channel|referrer|campaign and --limit. See Retention by channel.
paymentsPayments, newest first, with the source and campaign credited and the visitor ID. Takes --filter all|attributed|unattributed|refunded, --limit (up to 200) and --offset.
visitor <ID>One visitor’s visits, pages, goals, exits and payments, oldest first.

Breakdowns take --limit (default 20) and are sorted by revenue, then visitors. Every command has examples in virling query <COMMAND> --help.

$ export VIRLING_URL=https://stats.example.com VIRLING_API_KEY=vk_...
$ virling query channels --range 30d
example.com  2026-09-17 to 2026-10-16 (UTC)

Channel       Visitors  Payments    Revenue  Per visitor
Search           1,020        11    $539.00        $0.53
AI                 210         9    $441.00        $2.10
Unattributed         0         7    $343.00            -
Direct             610         4    $196.00        $0.32

Errors go to standard error with a non-zero exit code, such as a wrong key (401) or a site of another account (404).

Not available yet

  • Removing a site or a user from the CLI Not available yet

Connect your payment provider and see revenue by channel.

Start free
Was this page helpful?No Edit this page on GitHub