virling Docs
v0.1.0 virling.com GitHub
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.
--base-url <URL>
VIRLING_BASE_URL
http://localhost:8080Public URL of this server, used in sign-in links and script snippets.
--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.
--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.

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.

Not available yet

  • Removing a site or a user from the CLI Not available yet
  • Listing sites from the CLI Not available yet
Was this page helpful?No Edit this page on GitHub