Locallytics

CLI

Database management commands.

The locallytics-cli manages your database schema. No global install needed.

Commands

migrate

Creates the required database tables. Run this during initial setup or after package updates.

npx locallytics-cli migrate

Requires: DATABASE_URL environment variable.

export DATABASE_URL="postgresql://user:pass@localhost:5432/mydb"
npx locallytics-cli migrate

reset

Destructive

This deletes all analytics data. You will be prompted to confirm.

Drops and recreates the locallytics_pageviews table.

npx locallytics-cli reset

You'll need to type yes to confirm.

On this page