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.
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:
docker compose exec opentremor-core python -m opentremor_core.cli grant-superadmin --email [email protected]init-db — prepare MongoDB
Section titled “init-db — prepare MongoDB”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.
# Indexes onlyopentremor-admin init-db
# ...and a readWrite application user, created through an admin connectionopentremor-admin init-db \ --admin-uri mongodb://admin:secret@localhost:27017 \ --app-user opentremor_app \ --app-password changeme| Flag | Description |
|---|---|
--admin-uri URI | A connection allowed to create users, used only for --app-user; defaults to the config’s URI |
--app-user NAME | Create this readWrite user on the configured database |
--app-password PASS | Its 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.
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.