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 migrateRequires: DATABASE_URL environment variable.
export DATABASE_URL="postgresql://user:pass@localhost:5432/mydb"
npx locallytics-cli migratereset
Destructive
This deletes all analytics data. You will be prompted to confirm.
Drops and recreates the locallytics_pageviews table.
npx locallytics-cli resetYou'll need to type yes to confirm.