CLI
virling [--data-dir <DIR>] [COMMAND]
| Option and env | Default | What it does |
|---|---|---|
--data-dir <DIR>VIRLING_DATA | ./virling-data | Folder for the SQLite and DuckDB files. Works before or after the command. |
-h, --help | Print help. | |
-V, --version | Print 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 env | Default | What it does |
|---|---|---|
--addr <ADDR>VIRLING_ADDR | 0.0.0.0:8080 | Address and port to listen on. |
--appVIRLING_APP | off | Serve sign-in and the app, and run payment sync. |
--base-url <URL>VIRLING_BASE_URL | http://localhost:8080 | Public URL of this server, used in sign-in links and script snippets. |
--secret-key <HEX>VIRLING_SECRET_KEY | unset | 64 hex characters used to encrypt provider keys. Unset: secret.key in the data folder. |
--trust-proxyVIRLING_TRUST_PROXY | off | Read the client IP from X-Forwarded-For. |
--events-per-second <N>VIRLING_EVENTS_PER_SECOND | 200 | Ingest limit per site. Events over it are dropped. |
--smtp-url <URL>VIRLING_SMTP_URL | unset | SMTP server for sign-in emails. Unset: emails are logged. |
--mail-from <ADDR>VIRLING_MAIL_FROM | Virling <login@virling.com> | Sender for sign-in emails. |
--marketingVIRLING_MARKETING | off | Serve 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>]
| Argument | Default | What 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> | UTC | IANA 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