An interactive CLI tool for managing Swetrix.
- Node.js >= 22
- Access to the Swetrix MySQL and ClickHouse databases
- Environment variables configured (either in
admin/.envorbackend/.env)
cd admin
npm installThe CLI reads database configuration from environment variables. You can either:
- Create an
.envfile in theadmin/directory - Or rely on the existing
backend/.envfile (it will be auto-loaded)
Required environment variables:
# MySQL
MYSQL_HOST=localhost
MYSQL_USER=root
MYSQL_ROOT_PASSWORD=your_password
MYSQL_DATABASE=analytics
# ClickHouse
CLICKHOUSE_HOST=http://localhost
CLICKHOUSE_PORT=8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=
CLICKHOUSE_DATABASE=analyticsRun the CLI using:
npm run devOr build and run:
npm run build
node dist/index.js