Skip to content
DashboardWebsite

Tools

opentremor-admin runs operator commands directly against the database. It reads the server’s config file from --config FILE or, if you omit that flag, from CONFIG_FILE. MONGODB_URI overrides the URI in the config file, as it does for the server.

Terminal window
opentremor-admin --config configs/opentremor-core.yaml <command> ...

The container image does not install console scripts. Run the same commands with python -m opentremor_core.cli:

Terminal window
docker compose exec opentremor-core python -m opentremor_core.cli grant-superadmin --email [email protected]

Creates the collections and indexes declared for the platform and analysis engine in the configured database. It can also create a least-privilege application user. This command works like POST /v1/admin/storage/prepare-mongodb, but does not require a running server. It uses the same index declarations that the server applies at startup, so they cannot drift apart. Safe to rerun.

Terminal window
# Indexes only
opentremor-admin init-db
# ...and a readWrite application user, created through an admin connection
opentremor-admin init-db \
--admin-uri mongodb://admin:secret@localhost:27017 \
--app-user opentremor_app \
--app-password changeme
FlagDescription
--admin-uri URIA connection allowed to create users, used only for --app-user; defaults to the config’s URI
--app-user NAMECreate this readWrite user on the configured database
--app-password PASSIts password (required with --app-user)

A collection with no declared index appears on its first write, not during this command.


grant-superadmin — bootstrap a platform admin

Section titled “grant-superadmin — bootstrap a platform admin”

Grants or revokes is_superadmin, a permission axis independent of a user’s role in any org. It gates access to the cross-tenant Platform Admin surface. There is no in-app way to create the first superadmin: POST /v1/admin/users/{user_id}/superadmin itself requires one. Register a user first with POST /v1/auth/register, then use this command to set the flag. You can grant later superadmins through the API.

Terminal window
opentremor-admin grant-superadmin --email [email protected]
opentremor-admin grant-superadmin --email [email protected] --revoke

The user sees the change at their next login or POST /v1/auth/session/switch. is_superadmin is part of the session token, like org_id and role.